页面JS:
export async function mounted() {
let getAllData = await this.business.executeGlobalserviceApI({
params: [],
methodName: 'updateValue',
})
console.log(getAllData,123)
}
自定义函数:
var API = {
updateValue: function (){
return {
param1: 123,
param2: 456
}
}
}
运行结果:
TypeError: 'caller','callee', and 'arguments' properties may not be accessed on striat Function.invokeGetter (:3:28)
你要用的是这个API:executeServiceAPI
export function mounted() {
let ret = await this.business.executeServiceAPI({
applicationId: 当前应用id,
customJsId: 当前表单脚本id,需要通过F12控制台获取,后续会进行优化
params: [参数1,参数2,参数3],
methodName: 需要调用的自定义函数名
})
console.log(ret)
// {参数1, 参数2, 参数3}
}