Skip to content

Commit

Permalink
fix(table): submitButtonOptions not work,fix #531
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Apr 24, 2021
1 parent ca71760 commit 16ecf71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/Table/src/BasicTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
submitOnReset
v-bind="getFormProps"
v-if="getBindValues.useSearchForm"
:submitButtonOptions="{ loading: getLoading }"
:tableAction="tableAction"
@register="registerForm"
@submit="handleSearchInfoChange"
Expand Down Expand Up @@ -182,7 +181,7 @@
replaceFormSlotKey,
getFormSlotKeys,
handleSearchInfoChange,
} = useTableForm(getProps, slots, fetch);
} = useTableForm(getProps, slots, fetch, getLoading);
const getBindValues = computed(() => {
const dataSource = unref(getDataSourceRef);
Expand Down
5 changes: 4 additions & 1 deletion src/components/Table/src/hooks/useTableForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import { isFunction } from '/@/utils/is';
export function useTableForm(
propsRef: ComputedRef<BasicTableProps>,
slots: Slots,
fetch: (opt?: FetchParams | undefined) => Promise<void>
fetch: (opt?: FetchParams | undefined) => Promise<void>,
getLoading: ComputedRef<boolean | undefined>
) {
const getFormProps = computed(
(): Partial<FormProps> => {
const { formConfig } = unref(propsRef);
const { submitButtonOptions } = formConfig || {};
return {
showAdvancedButton: true,
...formConfig,
submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions },
compact: true,
};
}
Expand Down

0 comments on commit 16ecf71

Please sign in to comment.