使用Promise实现顺序执行
Promise.resolve().then(res => {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(1)
resolve()
}, 1000)
})
}).then(() => {
return new Promise((resolve, reject) => {
setTimeout(() => {
.
原创
2020-08-31 17:07:46 ·
758 阅读 ·
1 评论