this.a1().then(this.a2).then(this.a3)
.then(function(data) {
console.log('data: ' + data);
})
.catch(function(error) {
console.log('error: ' + error);
});
a1() {
return new Promise(function(resolve, reject) {
resolve(123);
});
},
a2() {
return new Promise(function(resolve, reject) {
resolve(456);
});
},
a3() {
return new Promise(function(resolve, reject) {
resolve(789);
});
},
uniapp promise
最新推荐文章于 2024-10-15 17:00:02 发布