我想从doinit访问变量以保存开销方法。我试图在saveExpense中访问临时变量。控制台正在抛出未定义的
({
doInit: function(component, event, helper) {
helper.getMatrix(component, event);
helper.getRolesConverted(component, event);
var temp=0;
},
saveExpenses: function(component, event, helper) {
helper.saveExpenses(component, event);
console.log('temp value ',temp);
},
});
答案 0 :(得分:0)
var temp;
({
doInit: function(component, event, helper) {
helper.getMatrix(component, event);
helper.getRolesConverted(component, event);
temp=0;
},
saveExpenses: function(component, event, helper) {
helper.saveExpenses(component, event);
console.log('temp value ',temp);
},
});