yeoolhj 1 year ago
parent
commit
3ce537e1e3
2 changed files with 7 additions and 4 deletions
  1. 6 3
      src/modules/editor/module/actions/init.ts
  2. 1 1
      src/modules/editor/module/index.ts

+ 6 - 3
src/modules/editor/module/actions/init.ts

@@ -1,3 +1,4 @@
+import { createProxyEffect } from "queenjs";
 import { EditorModule } from "..";
 import { EditorMode } from "../../typings";
 import { editActions } from "./edit";
@@ -8,9 +9,11 @@ export const initActions = EditorModule.action({
     const { historyCtrl } = this.controls;
     historyCtrl.proxyActions(Object.keys(editActions));
     this.controls.compUICtrl.init();
-    // createProxyEffect(this.store, (type, paths, value) => {
-    //   historyCtrl.onChange(this.store, type, paths, value);
-    // });
+
+    createProxyEffect(this.store, (type, paths, value) => {
+      console.log(type, paths, value);
+      historyCtrl.onChange(this.store, type, paths, value);
+    });
   },
 
   // 初始化数据

+ 1 - 1
src/modules/editor/module/index.ts

@@ -23,7 +23,7 @@ export class EditorModule extends ModuleRoot {
 
   actions = this.createActions([initActions, editActions, ImgCompActions]);
   https = this.createHttps(https);
-  store = this.createStore(store);
+  store = this.createStore(store, { useProxy: true });
   helper = this.createHelper(helpers);
 
   controls = {