Browse Source

fix: 修改tab的同步时机

bill 2 tháng trước cách đây
mục cha
commit
ba7077d59e
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      src/core/components/table/table.vue

+ 4 - 3
src/core/components/table/table.vue

@@ -27,7 +27,6 @@ import {
   TableData,
   getMouseStyle,
   defaultStyle,
-  TableCollData,
   matResponse,
   getColMinSize,
 } from "./index.ts";
@@ -193,7 +192,6 @@ const sync = (data: TableData) => {
     const tf = new Transform(data.mat);
     setShapeTransform(repShape, tf);
     initData = copy(data);
-    shape.value?.getNode().fire("bound-change");
     transformer.forceUpdate();
   }
 };
@@ -222,6 +220,9 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
         sync(data.value);
         return {
           shape: repShape as any,
+          update(data) {
+            sync(data);
+          },
         };
       },
       beforeHandler(data, mat) {
@@ -232,7 +233,7 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
       },
       callback(data) {
         callback();
-        nextTick(() => sync(data));
+        nextTick(() => shape.value?.getNode().fire("bound-change"));
       },
     });
   },