From 41725072cc03d4a3b7aa66997ae7ec370fbbc0cb Mon Sep 17 00:00:00 2001 From: vben Date: Sat, 5 Oct 2024 22:22:19 +0800 Subject: [PATCH] fix: the vxeUI global configuration does not take effect --- packages/effects/plugins/src/vxe-table/use-vxe-grid.vue | 5 ++++- 1 file changed, 4 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 f8574a5db7b..cc0d91a285f 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -63,6 +63,8 @@ const options = computed(() => { const slotActions = slots['toolbar-actions']?.(); const slotTools = slots['toolbar-tools']?.(); + const globalGridConfig = VxeUI?.getConfig()?.grid ?? {}; + const forceUseToolbarOptions = showToolbar.value ? { toolbarConfig: { @@ -79,6 +81,7 @@ const options = computed(() => { {}, forceUseToolbarOptions, toRaw(gridOptions.value), + globalGridConfig, ), ); @@ -205,7 +208,7 @@ async function init() { } // form 由 vben-form代替,所以不适配formConfig,这里给出警告 - const formConfig = options.value.formConfig; + const formConfig = gridOptions.value?.formConfig; if (formConfig) { console.warn( '[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props',