liwei 1 year ago
parent
commit
1fd59f878b

+ 2 - 1
src/modules/editor/module/actions/edit.ts

@@ -26,7 +26,8 @@ export const editActions = EditorModule.action({
 
     //点击默认都创建一个容器
     //创建容器
-    const isCreatCard =  compKey != "Text"
+    const isCreatCard =  compKey != "Text" && compKey != "Image" && compKey != "Video" && compKey != "Web3D";
+    
     let yOffset = 0;
     if (this.store.currCompId != this.store.currStreamCardId && !isCreatCard) {
         const bound = this.helper.getCardCompBound(this.store.currCompId);

+ 2 - 0
src/modules/editor/module/helpers/index.ts

@@ -135,6 +135,8 @@ export const helpers = EditorModule.helper({
   },
 
   extendStreamCard(streamCardId: string) {
+    if (!streamCardId) return;
+    
     const compMap = this.store.designData.compMap;
     const card = compMap[streamCardId];
     const childs = card.children.default || [];