Explorar el Código

fix: can't set variable in JS block

Ahmad Kholid hace 2 años
padre
commit
b31487c556
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/sandbox/utils/handleJavascriptBlock.js

+ 3 - 0
src/sandbox/utils/handleJavascriptBlock.js

@@ -44,6 +44,9 @@ export default function (data) {
         return window.$getNestedProperties(${propertyName}.refData, keyword + '.' + path);
       }
       function automaSetVariable(name, value) {
+        const variables = ${propertyName}.refData.variables;
+        if (!variables) ${propertyName}.refData.variables = {}
+
         ${propertyName}.refData.variables[name] = value;
       }
       function automaNextBlock(data = {}, insert = true) {