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

18 lines
475 B
Vue
Raw Normal View History

2024-09-06 10:39:19 +08:00
<template>
<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` }">
<use :href="`#${fontClass}`" />
2024-09-06 10:39:19 +08:00
</svg>
</template>
<script setup lang="ts">
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>