mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-24 10:33:47 +08:00
fix(table): submitButtonOptions not work,fix #531
This commit is contained in:
parent
ca717602a6
commit
16ecf71850
@ -4,7 +4,6 @@
|
|||||||
submitOnReset
|
submitOnReset
|
||||||
v-bind="getFormProps"
|
v-bind="getFormProps"
|
||||||
v-if="getBindValues.useSearchForm"
|
v-if="getBindValues.useSearchForm"
|
||||||
:submitButtonOptions="{ loading: getLoading }"
|
|
||||||
:tableAction="tableAction"
|
:tableAction="tableAction"
|
||||||
@register="registerForm"
|
@register="registerForm"
|
||||||
@submit="handleSearchInfoChange"
|
@submit="handleSearchInfoChange"
|
||||||
@ -182,7 +181,7 @@
|
|||||||
replaceFormSlotKey,
|
replaceFormSlotKey,
|
||||||
getFormSlotKeys,
|
getFormSlotKeys,
|
||||||
handleSearchInfoChange,
|
handleSearchInfoChange,
|
||||||
} = useTableForm(getProps, slots, fetch);
|
} = useTableForm(getProps, slots, fetch, getLoading);
|
||||||
|
|
||||||
const getBindValues = computed(() => {
|
const getBindValues = computed(() => {
|
||||||
const dataSource = unref(getDataSourceRef);
|
const dataSource = unref(getDataSourceRef);
|
||||||
|
@ -6,14 +6,17 @@ import { isFunction } from '/@/utils/is';
|
|||||||
export function useTableForm(
|
export function useTableForm(
|
||||||
propsRef: ComputedRef<BasicTableProps>,
|
propsRef: ComputedRef<BasicTableProps>,
|
||||||
slots: Slots,
|
slots: Slots,
|
||||||
fetch: (opt?: FetchParams | undefined) => Promise<void>
|
fetch: (opt?: FetchParams | undefined) => Promise<void>,
|
||||||
|
getLoading: ComputedRef<boolean | undefined>
|
||||||
) {
|
) {
|
||||||
const getFormProps = computed(
|
const getFormProps = computed(
|
||||||
(): Partial<FormProps> => {
|
(): Partial<FormProps> => {
|
||||||
const { formConfig } = unref(propsRef);
|
const { formConfig } = unref(propsRef);
|
||||||
|
const { submitButtonOptions } = formConfig || {};
|
||||||
return {
|
return {
|
||||||
showAdvancedButton: true,
|
showAdvancedButton: true,
|
||||||
...formConfig,
|
...formConfig,
|
||||||
|
submitButtonOptions: { loading: unref(getLoading), ...submitButtonOptions },
|
||||||
compact: true,
|
compact: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user