From 4b94d6214555414dc254e12a1ac3d32ab996bd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?1302=E5=B2=81=E7=9A=84=E9=BE=99=E7=8C=AB?= Date: Sat, 2 Nov 2024 14:31:46 +0800 Subject: [PATCH] fix: When multiple Tables are loaded on a page, a warning will be reported in the initialization of Tables after the second one (#4791) --- packages/effects/plugins/src/vxe-table/use-vxe-grid.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue index 3a46a683..1ecd72a7 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -220,7 +220,9 @@ async function init() { // form 由 vben-form代替,所以不适配formConfig,这里给出警告 const formConfig = gridOptions.value?.formConfig; - if (formConfig) { + // 处理某个页面加载多个Table时,第2个之后的Table初始化报出警告 + // 因为第一次初始化之后会把defaultGridOptions和gridOptions合并后缓存进State + if (formConfig && formConfig.enabled) { console.warn( '[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props', );