From 085b53f1a4f05b8e02389f75136f4b6619d2b3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Mon, 24 Jul 2023 23:57:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20:recycle:=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=20`shims-vue.d.ts`=20=E6=96=87=E4=BB=B6=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 6f58051faefaafb0fc3b26bcd1d9a80adb86d5e5 --- src/shims-vue.d.ts | 1 - src/types/shims-vue.d.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 src/shims-vue.d.ts create mode 100644 src/types/shims-vue.d.ts diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts deleted file mode 100644 index 1be3a22..0000000 --- a/src/shims-vue.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'xlsx/xlsx.mjs' diff --git a/src/types/shims-vue.d.ts b/src/types/shims-vue.d.ts new file mode 100644 index 0000000..abbc931 --- /dev/null +++ b/src/types/shims-vue.d.ts @@ -0,0 +1 @@ +declare module "xlsx/xlsx.mjs"; From 3e8df9a431862ba2f079ffc091d0182d0a8bafd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Fri, 4 Aug 2023 12:58:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20:sparkles:=20=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81`Number`=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitee.com/youlaiorg/vue3-element-admin/issues/I7N3DO #I7N3DO Former-commit-id: 68a8da9e2d19e2ab3f842d3d97fb8850406d30c3 --- src/components/Dictionary/index.vue | 14 +++++++++++--- src/types/global.d.ts | 2 +- src/views/demo/dict.vue | 15 +++++++++++++-- src/views/demo/table.vue | 1 + 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/components/Dictionary/index.vue b/src/components/Dictionary/index.vue index 892cc64..a19788a 100644 --- a/src/components/Dictionary/index.vue +++ b/src/components/Dictionary/index.vue @@ -5,6 +5,7 @@ :placeholder="placeholder" :disabled="disabled" clearable + @change="handleChange" > = ref([]); // 字典下拉数据源 -const options: Ref = ref([]); +const selectedValue = computed(() => props.modelValue.toString()); // 将父组件的值统一转化String和下拉数据源进行比较,避免值的类型不一致导致回显失败 + +function handleChange(val?: string) { + emits("update:modelValue", val); +} onBeforeMount(() => { // 根据字典类型编码(typeCode)获取字典选项 diff --git a/src/types/global.d.ts b/src/types/global.d.ts index ad7b72b..bdea190 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -41,7 +41,7 @@ declare global { /** * 值 */ - value: number; + value: string; /** * 文本 */ diff --git a/src/views/demo/dict.vue b/src/views/demo/dict.vue index 4c82ef7..bcd594d 100644 --- a/src/views/demo/dict.vue +++ b/src/views/demo/dict.vue @@ -1,6 +1,7 @@