policeSecurity/policeManagement/src/components/iconfont/IconFont.vue

18 lines
471 B
Vue
Raw Normal View History

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` }"/>
<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,
type: 'svg',
})
2024-09-06 10:39:19 +08:00
</script>
<style scoped lang="scss"></style>