From 16ecf71850675be0031f41c8cb91371cf07cbea0 Mon Sep 17 00:00:00 2001 From: Vben Date: Sat, 24 Apr 2021 18:27:48 +0800 Subject: [PATCH] fix(table): submitButtonOptions not work,fix #531 --- src/components/Table/src/BasicTable.vue | 3 +-- src/components/Table/src/hooks/useTableForm.ts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue index 86a56a53..733cf2ba 100644 --- a/src/components/Table/src/BasicTable.vue +++ b/src/components/Table/src/BasicTable.vue @@ -4,7 +4,6 @@ submitOnReset v-bind="getFormProps" v-if="getBindValues.useSearchForm" - :submitButtonOptions="{ loading: getLoading }" :tableAction="tableAction" @register="registerForm" @submit="handleSearchInfoChange" @@ -182,7 +181,7 @@ replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange, - } = useTableForm(getProps, slots, fetch); + } = useTableForm(getProps, slots, fetch, getLoading); const getBindValues = computed(() => { const dataSource = unref(getDataSourceRef); diff --git a/src/components/Table/src/hooks/useTableForm.ts b/src/components/Table/src/hooks/useTableForm.ts index 4d6afe44..500aa0b8 100644 --- a/src/components/Table/src/hooks/useTableForm.ts +++ b/src/components/Table/src/hooks/useTableForm.ts @@ -6,14 +6,17 @@ import { isFunction } from '/@/utils/is'; export function useTableForm( propsRef: ComputedRef, slots: Slots, - fetch: (opt?: FetchParams | undefined) => Promise + fetch: (opt?: FetchParams | undefined) => Promise, + getLoading: ComputedRef ) { const getFormProps = computed( (): Partial => { const { formConfig } = unref(propsRef); + const { submitButtonOptions } = formConfig || {}; return { showAdvancedButton: true, ...formConfig, + submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions }, compact: true, }; } -- GitLab