不同文件:
https://www.jianshu.com/p/6e5301587ccf
相同文件:
//原理:运行函数时候,把另一个函数作为参数。
onShow: function () {
//调用
var that = this;
that.aaa('10sdfsdfsdfsdfsdfasdf', function (res) {
console.log(res);
}
);
},
//原始
aaa:function(bbb,ddd){
ddd(bbb);
},
//-------------原型
onShow: function () {
that.aaa('10sdfsdfsdfsdfsdfasdf', that.xxxx
);
},
aaa:function(bbb,ddd){
ddd(bbb);
},
xxxx:function(res){
console.log(res);
},
网友评论