添加函数返回、完善注入JS功能

This commit is contained in:
fofolee
2025-01-22 00:52:53 +08:00
parent 0094cb6c29
commit d69c473fe7
5 changed files with 116 additions and 4 deletions

View File

@@ -102,6 +102,9 @@ export default defineComponent({
this.updateModelValue(this.funcName, newArgvs);
},
generateCode(funcName, argvs) {
if (this.localCommand.isExpression) {
return argvs.join("");
}
/**
* 字符串模式stringfiy后null会变成'"null"', ''变成'""'
* 变量模式stringify后null变成'null', ''保持''
@@ -140,6 +143,10 @@ export default defineComponent({
let argvs = window.lodashM.cloneDeep(this.defaultArgvs);
if (!code) return argvs;
if (this.localCommand.isExpression) {
return [code];
}
const variableFormatPaths = [];
const addVariableFormatPath = (prefix, config) => {