Files
JuYou/ADMIN/src/components/AppIcon.vue
T
2026-08-25 17:59:42 +08:00

30 lines
580 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 剧游AI管理后台图标组件统一封装第三方图标库的使用入口 -->
<script setup lang="ts">
import { computed } from "vue";
import * as Icons from "@element-plus/icons-vue";
type IconName = keyof typeof Icons;
interface Props {
name: IconName;
size?: number | string;
color?: string;
}
const props = withDefaults(defineProps<Props>(), {
size: 16,
});
const iconComponent = computed(() => Icons[props.name]);
</script>
<template>
<el-icon
:size="size"
:color="color"
>
<component :is="iconComponent" />
</el-icon>
</template>