Browse Source

Merge branch 'master' of http://47.110.251.215:3000/web/saber into master

zhangh 3 years ago
parent
commit
fb6a21091e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/views/formula/formulaStringToArray.js

+ 6 - 1
src/views/formula/formulaStringToArray.js

@@ -225,7 +225,12 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
       }
       
       let content =contentStack[contentStack.length - 1];
-      content.children.push(obj);
+      if(content){
+        content.children.push(obj);
+      }else{
+        //如果没有,那就是在最上层
+        resArr.push(obj);
+      }
 
       strIndex += eleArr[0].length;//索引移动
     }else if(commaReg.test(nuText)){