瀏覽代碼

perf(components): 优化图标组件,阻止点击事件冒泡

wangcong 2 月之前
父節點
當前提交
99814f1a58
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/components/SvgIcon.vue

+ 1 - 1
src/components/SvgIcon.vue

@@ -31,5 +31,5 @@ const iconStyle = computed<CSSProperties>(() => {
 </script>
 
 <template>
-  <i :class="iconClass" :style="iconStyle" @click="$emit('click')"></i>
+  <i :class="iconClass" :style="iconStyle" @click.stop="$emit('click')"></i>
 </template>