فهرست منبع

fix(table): submitButtonOptions not work,fix #531

Vben 4 سال پیش
والد
کامیت
16ecf71850
2فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 1 2
      src/components/Table/src/BasicTable.vue
  2. 4 1
      src/components/Table/src/hooks/useTableForm.ts

+ 1 - 2
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);

+ 4 - 1
src/components/Table/src/hooks/useTableForm.ts

@@ -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,
       };
     }