Browse Source
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>
pull/2555/head
Wit〆苗大
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
3 deletions
-
src/components/Table/src/components/TableAction.vue
-
src/views/demo/table/VxeTable.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), |
|
|
|
}; |
|
|
|
|
|
|
|
@ -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: { |
|
|
|
|