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

18 lines
471 B
Vue

<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}`"/>
</svg>
</template>
<script setup lang="ts">
import {IconFontProps} from '@/types/components/iconfont/IconFont'
withDefaults(defineProps<IconFontProps>(), {
size: 25,
type: 'svg',
})
</script>
<style scoped lang="scss"></style>