关于promise 控制函数先后,解决回调地狱问题
created() {
this.function1().then(data=>{
console.log("data===",data)
this.function2();
})
},
methods: {
function1(){
return new Promise((resolve, reject) => {
service.fun(res=>){
this.a=res
...
原创
2022-04-24 15:12:23 ·
99 阅读 ·
0 评论