fix: the vxeUI global configuration does not take effect (#4574)

pull/48/MERGE
Vben 2024-10-05 22:30:13 +08:00 committed by GitHub
parent 47d162e6e4
commit 9ad4f96e38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -63,6 +63,8 @@ const options = computed(() => {
const slotActions = slots['toolbar-actions']?.(); const slotActions = slots['toolbar-actions']?.();
const slotTools = slots['toolbar-tools']?.(); const slotTools = slots['toolbar-tools']?.();
const globalGridConfig = VxeUI?.getConfig()?.grid ?? {};
const forceUseToolbarOptions = showToolbar.value const forceUseToolbarOptions = showToolbar.value
? { ? {
toolbarConfig: { toolbarConfig: {
@ -79,6 +81,7 @@ const options = computed(() => {
{}, {},
forceUseToolbarOptions, forceUseToolbarOptions,
toRaw(gridOptions.value), toRaw(gridOptions.value),
globalGridConfig,
), ),
); );
@ -205,7 +208,7 @@ async function init() {
} }
// form vben-formformConfig // form vben-formformConfig
const formConfig = options.value.formConfig; const formConfig = gridOptions.value?.formConfig;
if (formConfig) { if (formConfig) {
console.warn( console.warn(
'[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props', '[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props',