🎨添加静态打包
This commit is contained in:
33
web/src/components/icon/TheIcon.vue
Normal file
33
web/src/components/icon/TheIcon.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<script setup>
|
||||
import { renderIcon, renderCustomIcon } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
icon: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 14,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
/** iconify | custom */
|
||||
type: {
|
||||
type: String,
|
||||
default: 'iconify',
|
||||
},
|
||||
})
|
||||
|
||||
const iconCom = computed(() =>
|
||||
props.type === 'iconify'
|
||||
? renderIcon(props.icon, { size: props.size, color: props.color })
|
||||
: renderCustomIcon(props.icon, { size: props.size, color: props.color })
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="iconCom" />
|
||||
</template>
|
Reference in New Issue
Block a user