From 226b7470ecb31c9deadc1440998dd7d28b36fac1 Mon Sep 17 00:00:00 2001 From: bighuixiang <472705331@qq.com> Date: Wed, 18 Jun 2025 23:59:18 +0800 Subject: [PATCH] refactor: simplify SvgIcon component by removing unused img tag and cleaning up iconName computation --- src/component/Canvas/SvgIcon/index.vue | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/component/Canvas/SvgIcon/index.vue b/src/component/Canvas/SvgIcon/index.vue index bdb09126..009feea6 100644 --- a/src/component/Canvas/SvgIcon/index.vue +++ b/src/component/Canvas/SvgIcon/index.vue @@ -1,16 +1,12 @@ @@ -30,12 +26,7 @@ const props = defineProps({ default: 16, }, }); -const iconName = computed(() => { - console.log(require(`@/assets/icons/${props.name}.svg`)) - return require(`@/assets/icons/${props.name}.svg`) - return imgUrl -}); -// const iconName = computed(() => `#icon-${props.name}`); +const iconName = computed(() => `#icon-${props.name}`); const svgClass = computed(() => { if (props.name) return `svg-icon icon-${props.name}`; return "svg-icon";