From 27ba504441037666e787ded85b4af2f65be65c17 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周二, 29 4月 2025 18:06:07 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- HIAWms/web/src/components/Icon/Icon.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/HIAWms/web/src/components/Icon/Icon.tsx b/HIAWms/web/src/components/Icon/Icon.tsx new file mode 100644 index 0000000..5b5d157 --- /dev/null +++ b/HIAWms/web/src/components/Icon/Icon.tsx @@ -0,0 +1,37 @@ +import { computed, defineComponent } from 'vue' +export default defineComponent({ + name: '鍥炬爣', + props: { + icon: { + type: String, + default: '', + }, + width: { + type: Number, + default: 12, + }, + height: { + type: Number, + default: 12, + }, + }, + emits: ['click'], + setup(props, { attrs, slots, emit }) { + const imgUrl = computed(() => { + const imgName = props.icon + return new URL(`../../assets/images/${imgName}.png`, import.meta.url).href + }) + + return () => { + return ( + <img + onClick={(evt: Event) => emit('click', evt)} + width={props.width} + height={props.height} + src={imgUrl.value} + {...attrs} + /> + ) + } + }, +}) -- Gitblit v1.9.3