0

我想从 doinit 访问变量到 saveexpenses 方法。我正在尝试访问 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);
},
});
4

1 回答 1

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);
},
});
于 2018-05-03T10:31:49.183 回答