Commit d81481c52186145dac130aaa1594f0ba8db4d392

Authored by Vben
1 parent 19d8e01e

fix(table): try to get close to the form stuck

src/components/Table/src/hooks/useTable.ts
... ... @@ -2,10 +2,16 @@ import type { BasicTableProps, TableActionType, FetchParams, BasicColumn } from
2 2 import type { PaginationProps } from '../types/pagination';
3 3 import type { DynamicProps } from '/#/utils';
4 4 import type { FormActionType } from '/@/components/Form';
5   -import type { WatchStopHandle } from 'vue';
  5 +// import type { WatchStopHandle } from 'vue';
6 6  
7 7 import { getDynamicProps } from '/@/utils';
8   -import { ref, onUnmounted, unref, watch, toRaw } from 'vue';
  8 +import {
  9 + ref,
  10 + onUnmounted,
  11 + unref,
  12 + // watch,
  13 + toRaw,
  14 +} from 'vue';
9 15 import { isProdMode } from '/@/utils/env';
10 16 import { error } from '/@/utils/log';
11 17  
... ... @@ -25,7 +31,7 @@ export function useTable(tableProps?: Props): [
25 31 const loadedRef = ref<Nullable<boolean>>(false);
26 32 const formRef = ref<Nullable<UseTableMethod>>(null);
27 33  
28   - let stopWatch: WatchStopHandle;
  34 + // let stopWatch: WatchStopHandle;
29 35  
30 36 function register(instance: TableActionType, formInstance: UseTableMethod) {
31 37 isProdMode() &&
... ... @@ -41,18 +47,18 @@ export function useTable(tableProps?: Props): [
41 47 tableProps && instance.setProps(getDynamicProps(tableProps));
42 48 loadedRef.value = true;
43 49  
44   - stopWatch?.();
  50 + // stopWatch?.();
45 51  
46   - stopWatch = watch(
47   - () => tableProps,
48   - () => {
49   - tableProps && instance.setProps(getDynamicProps(tableProps));
50   - },
51   - {
52   - immediate: true,
53   - deep: true,
54   - }
55   - );
  52 + // stopWatch = watch(
  53 + // () => tableProps,
  54 + // () => {
  55 + // tableProps && instance.setProps(getDynamicProps(tableProps));
  56 + // },
  57 + // {
  58 + // immediate: true,
  59 + // deep: true,
  60 + // }
  61 + // );
56 62 }
57 63  
58 64 function getTableInstance(): TableActionType {
... ...