Browse Source

修复屏幕切换的bug

liwei 1 year ago
parent
commit
90e207fef6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/editor/components/Viewport/Content/index.tsx

+ 2 - 2
src/modules/editor/components/Viewport/Content/index.tsx

@@ -80,7 +80,7 @@ export default defineUI({
                       style.border = "3px solid #EA9E40"
                     }
                   return (<Draggable>
-                      <div key={item} class={["card-item relative transition-opacity hover:opacity-80"]} style={style} onClick={()=>{
+                      <div key={item + controls.screenCtrl.currScreenId} class={["card-item relative transition-opacity hover:opacity-80"]} style={style} onClick={()=>{
                          actions.selectObjs([]);
                          actions.pickComp(item, false);
                          controls.editorCtrl.autoInScreen();
@@ -153,7 +153,7 @@ export default defineUI({
                       controls.compUICtrl.state.components.get(comp.compKey)
                         ?.Component || NotFoundComp;
                     return (
-                        <Comp compId={comp.id}  key={comp.id} showMask={true} />
+                        <Comp compId={comp.id}  key={comp.id + controls.screenCtrl.currScreenId} showMask={true} />
                     );
                   },
                 }}