Initial commit of akmon project
This commit is contained in:
73
components/simple-icon/simple-icon.uvue
Normal file
73
components/simple-icon/simple-icon.uvue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<text class="simple-icon" :style="iconStyle">{{ iconText }}</text>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
const props = defineProps<{
|
||||
type: string;
|
||||
size?: number | null;
|
||||
color?: string | null;
|
||||
}>()
|
||||
|
||||
const iconMap = {
|
||||
// 基本图标
|
||||
'plus': '+',
|
||||
'minus': '-',
|
||||
'close': '×',
|
||||
'closeempty': '×',
|
||||
'checkmarkempty': '✓',
|
||||
'check': '✓',
|
||||
'right': '→',
|
||||
'left': '←',
|
||||
'up': '↑',
|
||||
'down': '↓',
|
||||
|
||||
// 媒体图标
|
||||
'play-filled': '▶',
|
||||
'pause-filled': '⏸',
|
||||
'stop': '⏹',
|
||||
'refresh': '↻',
|
||||
|
||||
// 功能图标
|
||||
'home': '⌂',
|
||||
'person': '👤',
|
||||
'chat': '💬',
|
||||
'list': '☰',
|
||||
'bars': '☰',
|
||||
'calendar': '📅',
|
||||
'clock': '🕐',
|
||||
'info': 'ℹ',
|
||||
'help': '?',
|
||||
'trash': '🗑',
|
||||
'compose': '✏',
|
||||
'videocam': '📹',
|
||||
|
||||
// 体育分析相关图标
|
||||
'file': '📄',
|
||||
'trophy': '🏆',
|
||||
'star': '⭐',
|
||||
'bell': '🔔',
|
||||
|
||||
// 默认
|
||||
'default': '•'
|
||||
}
|
||||
|
||||
const iconText = computed(() => {
|
||||
return (iconMap[props.type] ?? iconMap['default']) as any
|
||||
})
|
||||
|
||||
const iconStyle = computed(() => {
|
||||
return {
|
||||
fontSize: `${props.size}px`,
|
||||
color: props.color,
|
||||
fontFamily: 'system-ui, -apple-system, sans-serif'
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.simple-icon {
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user