74 lines
1.3 KiB
Plaintext
74 lines
1.3 KiB
Plaintext
<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>
|