fix: create Icon component
This commit is contained in:
parent
8240d35e1e
commit
2b9c583b5d
21
frontend/src/components/Icon.vue
Normal file
21
frontend/src/components/Icon.vue
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="isEmoji(icon)" v-bind="$attrs">
|
||||||
|
{{ icon }}
|
||||||
|
</div>
|
||||||
|
<FeatherIcon
|
||||||
|
v-else-if="typeof icon == 'string'"
|
||||||
|
:name="icon"
|
||||||
|
v-bind="$attrs"
|
||||||
|
/>
|
||||||
|
<component v-else :is="icon" v-bind="$attrs" />
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { isEmoji } from '@/utils'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
icon: {
|
||||||
|
type: [String, Object],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
x
Reference in New Issue
Block a user