Skip to content

Commit 16ecf71

Browse files
committedApr 24, 2021
fix(table): submitButtonOptions not work,fix #531
1 parent ca71760 commit 16ecf71

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/components/Table/src/BasicTable.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
submitOnReset
55
v-bind="getFormProps"
66
v-if="getBindValues.useSearchForm"
7-
:submitButtonOptions="{ loading: getLoading }"
87
:tableAction="tableAction"
98
@register="registerForm"
109
@submit="handleSearchInfoChange"
@@ -182,7 +181,7 @@
182181
replaceFormSlotKey,
183182
getFormSlotKeys,
184183
handleSearchInfoChange,
185-
} = useTableForm(getProps, slots, fetch);
184+
} = useTableForm(getProps, slots, fetch, getLoading);
186185
187186
const getBindValues = computed(() => {
188187
const dataSource = unref(getDataSourceRef);

‎src/components/Table/src/hooks/useTableForm.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import { isFunction } from '/@/utils/is';
66
export function useTableForm(
77
propsRef: ComputedRef<BasicTableProps>,
88
slots: Slots,
9-
fetch: (opt?: FetchParams | undefined) => Promise<void>
9+
fetch: (opt?: FetchParams | undefined) => Promise<void>,
10+
getLoading: ComputedRef<boolean | undefined>
1011
) {
1112
const getFormProps = computed(
1213
(): Partial<FormProps> => {
1314
const { formConfig } = unref(propsRef);
15+
const { submitButtonOptions } = formConfig || {};
1416
return {
1517
showAdvancedButton: true,
1618
...formConfig,
19+
submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions },
1720
compact: true,
1821
};
1922
}

0 commit comments

Comments
 (0)