From 334a0ea8e5e7fe45ad4d0f0ac399bdb95ea0b023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wit=E3=80=86=E8=8B=97=E5=A4=A7?= <454690789@qq.com> Date: Fri, 10 Feb 2023 19:53:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(TableAction):=20=E4=BF=AE=E5=A4=8Doutside?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=BC=95=E7=94=A8=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=EF=BC=9BVxeTable=20demo=E5=BC=95=E7=94=A8TableAction=E6=94=B9?= =?UTF-8?q?=E4=B8=BAoutside=E6=A8=A1=E5=BC=8F,=20=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0keepSource=E4=BB=A5=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E8=AD=A6=E5=91=8A=20(#2544)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(TableAction): 修复outside模式引用时报错: TypeError: Cannot read properties of undefined (reading 'value') * perf(VxeTable): demo引用TableAction改为outside模式以解决警告; 属性添加keepSource以解决警告 --------- Co-authored-by: 苗大 --- src/components/Table/src/components/TableAction.vue | 4 ++-- src/views/demo/table/VxeTable.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index 4c5c1ed9..99425f9d 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -91,7 +91,7 @@ .map((action) => { const { popConfirm } = action; return { - getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body, + getPopupContainer: () => unref((table as any)?.wrapRef) ?? document.body, type: 'link', size: 'small', ...action, @@ -128,7 +128,7 @@ function getTooltip(data: string | TooltipProps): TooltipProps { return { - getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body, + getPopupContainer: () => unref((table as any)?.wrapRef) ?? document.body, placement: 'bottom', ...(isString(data) ? { title: data } : data), }; diff --git a/src/views/demo/table/VxeTable.vue b/src/views/demo/table/VxeTable.vue index b4a2954b..24b2163d 100644 --- a/src/views/demo/table/VxeTable.vue +++ b/src/views/demo/table/VxeTable.vue @@ -7,7 +7,7 @@ > @@ -27,6 +27,7 @@ const gridOptions = reactive({ id: 'VxeTable', + keepSource: true, editConfig: { trigger: 'click', mode: 'cell', showStatus: true }, columns: vxeTableColumns, toolbarConfig: {