各位老大,请教一下,在同一页面内,调用一个包含promise的程序模块,语法哪里错了呢?
onLoad: function(options) {
let a,b;
this._test(a,b).then(res => {
console.log('调用本页面内promise完成')
})
},
//待调用程序
_test = (a,b) => {
return new Promise((resolve, reject) => {
resolve()
})
},
执行结果如图:
onLoad: function () {
let a,b;
this._test(a,b).then(res => {
console.log('调用本页面内promise完成')
})
},
_test(a,b){
return new Promise((resolve, reject) => {
console.log(a,b)
resolve()
})
},