From 55bf797dcc730b37bc691ebab2b51ff9db8ed245 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周二, 06 5月 2025 17:37:23 +0800
Subject: [PATCH] 修改代码样式

---
 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