2024-09-06 10:39:19 +08:00
|
|
|
<template>
|
2024-09-11 09:22:32 +08:00
|
|
|
<i v-if="type === 'class'" :class="[`iconfont ${fontClass}`]" :style="{ fontSize: `${size}px` }"/>
|
2024-09-06 19:24:01 +08:00
|
|
|
<svg v-else-if="type === 'svg'" :style="{ width: `${size}px`, height: `${size}px` }">
|
2024-09-11 09:22:32 +08:00
|
|
|
<use :href="`#${fontClass}`"/>
|
2024-09-06 10:39:19 +08:00
|
|
|
</svg>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-09-11 09:22:32 +08:00
|
|
|
import {IconFontProps} from '@/types/components/iconfont/IconFont'
|
2024-09-06 10:39:19 +08:00
|
|
|
|
|
|
|
withDefaults(defineProps<IconFontProps>(), {
|
|
|
|
size: 25,
|
2024-09-06 19:24:01 +08:00
|
|
|
type: 'svg',
|
|
|
|
})
|
2024-09-06 10:39:19 +08:00
|
|
|
</script>
|
|
|
|
|
2024-09-06 19:24:01 +08:00
|
|
|
<style scoped lang="scss"></style>
|