问题
提示变量没有被声明
onLoad:(option)=>{
不能使用this
}
原因
因为onLoad不是方法中的子方法,而箭头函数中的this会变为父级的this,然而没有父级所以就会显示undefined
解决
onLoad:function(option){
}
提示变量没有被声明
onLoad:(option)=>{
不能使用this
}
因为onLoad不是方法中的子方法,而箭头函数中的this会变为父级的this,然而没有父级所以就会显示undefined
onLoad:function(option){
}