qinyan 1 년 전
부모
커밋
ae8b2ef3d0
1개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 16 5
      src/modules/editor/components/Viewport/Slider/SliderRight/CompTree.tsx

+ 16 - 5
src/modules/editor/components/Viewport/Slider/SliderRight/CompTree.tsx

@@ -1,14 +1,13 @@
+import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
 import { TreeToolbars } from "@/modules/editor/objects/Toolbars";
 import { css } from "@linaria/core";
 import { Image } from "@queenjs/ui";
 import { useReactive } from "@queenjs/use";
-import { Tree, TreeProps } from "ant-design-vue";
+import { Tree } from "ant-design-vue";
 import { defineComponent, nextTick, watch } from "vue";
-import { string, bool } from "vue-types";
+import { string } from "vue-types";
 import { useEditor } from "../../../..";
 import { DesignComp } from "../../../../objects/DesignTemp/DesignComp";
-import { TreeDataItem } from "ant-design-vue/lib/tree";
-import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
 
 type TreeItem = {
   key: string;
@@ -19,7 +18,17 @@ type TreeItem = {
 
 export const CompTree = defineComponent({
   setup() {
-    const { store, actions, helper, controls } = useEditor();
+    const { controls } = useEditor();
+    return () => {
+      const key = controls.pageCtrl.designData.title;
+      return <CompTreeMain key={key} />;
+    };
+  },
+});
+
+export const CompTreeMain = defineComponent({
+  setup() {
+    const { store, helper, controls } = useEditor();
     const { compUICtrl } = controls;
 
     const state = useReactive(() => ({
@@ -62,6 +71,7 @@ export const CompTree = defineComponent({
         });
       }
     );
+
     const onDrop = (info: any) => {
       const dragNode = info.dragNode; //被拖拽
       const dropNode = info.node; //拖拽落下
@@ -140,6 +150,7 @@ export const CompTree = defineComponent({
         helper.extendStreamCard(parentComp.id);
       });
     };
+
     const sortCompInCard = (
       parentComp: DesignComp,
       index: number,