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

26 lines
589 B
Vue
Raw Normal View History

2024-08-30 17:03:25 +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}`"/>
</svg>
</template>
<script setup lang="ts">
2024-09-10 16:47:54 +08:00
2024-08-30 17:03:25 +08:00
import {IconFontProps} from "@/types/components/iconfont/IconFont";
2024-09-10 16:47:54 +08:00
const props = withDefaults(defineProps<IconFontProps>(), {
2024-08-30 17:03:25 +08:00
size: 25,
type: "svg"
});
2024-09-10 16:48:52 +08:00
// import {onMounted} from "vue";
// onMounted(() => {
// console.log(props.fontClass, props.type);
// });
2024-08-30 17:03:25 +08:00
</script>
<style scoped lang="scss">
</style>