Page({
wait: function(){
// setTimeout(() => {console.log(222)},2000)
return new Promise((resolve,reject) => {
// setTimeout(() => {resolve(222)},2000)
setTimeout(function(){resolve(222)},2000)
})
},
onLoad: function (){
console.log(111);
// this.wait().then((res) => {console.log(res);});
this.wait().then(res => console.log(res))
console.log(333);
}
})
怎么样得到正确的打印结果“111 222 333”呢,有劳大神请教了哦!