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:
parent
bce6cee53a
commit
334a0ea8e5
|
|
@ -91,7 +91,7 @@
|
||||||
.map((action) => {
|
.map((action) => {
|
||||||
const { popConfirm } = action;
|
const { popConfirm } = action;
|
||||||
return {
|
return {
|
||||||
getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
|
getPopupContainer: () => unref((table as any)?.wrapRef) ?? document.body,
|
||||||
type: 'link',
|
type: 'link',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
...action,
|
...action,
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
|
|
||||||
function getTooltip(data: string | TooltipProps): TooltipProps {
|
function getTooltip(data: string | TooltipProps): TooltipProps {
|
||||||
return {
|
return {
|
||||||
getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
|
getPopupContainer: () => unref((table as any)?.wrapRef) ?? document.body,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
...(isString(data) ? { title: data } : data),
|
...(isString(data) ? { title: data } : data),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
>
|
>
|
||||||
<VxeBasicTable ref="tableRef" v-bind="gridOptions">
|
<VxeBasicTable ref="tableRef" v-bind="gridOptions">
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<TableAction :actions="createActions(row)" />
|
<TableAction outside :actions="createActions(row)" />
|
||||||
</template>
|
</template>
|
||||||
</VxeBasicTable>
|
</VxeBasicTable>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
const gridOptions = reactive<BasicTableProps>({
|
const gridOptions = reactive<BasicTableProps>({
|
||||||
id: 'VxeTable',
|
id: 'VxeTable',
|
||||||
|
keepSource: true,
|
||||||
editConfig: { trigger: 'click', mode: 'cell', showStatus: true },
|
editConfig: { trigger: 'click', mode: 'cell', showStatus: true },
|
||||||
columns: vxeTableColumns,
|
columns: vxeTableColumns,
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue