promise链式调用
that.test1().then(res => { return that.test2(res);}).then(res => { console.log(res); }) test1(){ var that = this; var p = new Promise((resolve,reject) => { resolve(‘hello ‘); }) return p; }, test2(params){ var that = this; var p = new Promise((resolve, reject) => { resolve(`${params}world!`); }) return p; },
相关推荐
nmgxzm00 2020-11-10
xixixi 2020-11-11
88254251 2020-11-01
MarukoMa 2020-09-02
88234852 2020-09-15
陈旭阳 2020-08-31
whynotgonow 2020-08-19
前端开发Kingcean 2020-07-30
whynotgonow 2020-07-29
bowean 2020-07-08
前端开发Kingcean 2020-07-08
88520191 2020-07-05
前端开发Kingcean 2020-06-27
88481456 2020-06-18
whynotgonow 2020-06-16
88520191 2020-06-13
88520191 2020-06-13
89500297 2020-06-13