fix(TableAction): 修复outside模式引用时报错;VxeTable demo引用TableAction改为outside模式, 属性添加keepSource以解决警告 (#2544)

* fix(TableAction): 修复outside模式引用时报错: TypeError: Cannot read properties of undefined (reading 'value')

* perf(VxeTable): demo引用TableAction改为outside模式以解决警告; 属性添加keepSource以解决警告

---------

Co-authored-by: 苗大 <caoshengmiao@hypergryph.com>
This commit is contained in:
Wit〆苗大 2023-02-10 19:53:32 +08:00 committed by GitHub
parent bce6cee53a
commit 334a0ea8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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),
};

View File

@ -7,7 +7,7 @@
>
<VxeBasicTable ref="tableRef" v-bind="gridOptions">
<template #action="{ row }">
<TableAction :actions="createActions(row)" />
<TableAction outside :actions="createActions(row)" />
</template>
</VxeBasicTable>
</PageWrapper>
@ -27,6 +27,7 @@
const gridOptions = reactive<BasicTableProps>({
id: 'VxeTable',
keepSource: true,
editConfig: { trigger: 'click', mode: 'cell', showStatus: true },
columns: vxeTableColumns,
toolbarConfig: {