From c5d24e07f029994e56ff27f73b3659ff186fd8dc Mon Sep 17 00:00:00 2001 From: invalid w Date: Tue, 26 Sep 2023 09:41:25 +0800 Subject: [PATCH] =?UTF-8?q?Chore:=20=E5=A4=84=E7=90=86=E4=BA=86Vben?= =?UTF-8?q?=E5=B0=81=E8=A3=85=E7=9A=84Drawer,Modal=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9B=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20(#3064)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: rm unuse params * chore(Modal): getCurrentInstance的uid类型为number * chore(Drawer): 调整drawer组件的一些类型问题 * chore(Drawer): 移除多余的classname配置 * chore(Drawer): 修复getContainer和antd4 drawer组件类型不一致 * fix(AppSearchModal): 调整setRefs函数的类型 --- packages/hooks/src/useRefs.ts | 8 ++++---- src/components/Drawer/src/BasicDrawer.vue | 2 +- src/components/Drawer/src/typing.ts | 6 +++--- src/components/Drawer/src/useDrawer.ts | 10 +++++----- src/components/Modal/src/components/ModalWrapper.vue | 2 +- src/components/Modal/src/hooks/useModal.ts | 10 +++++----- src/components/Modal/src/typing.ts | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/hooks/src/useRefs.ts b/packages/hooks/src/useRefs.ts index 62ac5dbc..efbaabd2 100644 --- a/packages/hooks/src/useRefs.ts +++ b/packages/hooks/src/useRefs.ts @@ -1,9 +1,9 @@ -import type { Ref } from 'vue'; +import type { ComponentPublicInstance, Ref } from 'vue'; import { onBeforeUpdate, shallowRef } from 'vue'; function useRefs(): { refs: Ref; - setRefs: (index: number) => (el: T) => void; + setRefs: (index: number) => (el: Element | ComponentPublicInstance | null) => void; } { const refs = shallowRef([]) as Ref; @@ -11,8 +11,8 @@ function useRefs(): { refs.value = []; }); - const setRefs = (index: number) => (el: T) => { - refs.value[index] = el; + const setRefs = (index: number) => (el: Element | ComponentPublicInstance | null) => { + refs.value[index] = el as T; }; return { diff --git a/src/components/Drawer/src/BasicDrawer.vue b/src/components/Drawer/src/BasicDrawer.vue index b3fd1222..6ab326f7 100644 --- a/src/components/Drawer/src/BasicDrawer.vue +++ b/src/components/Drawer/src/BasicDrawer.vue @@ -1,5 +1,5 @@