其他分享
首页 > 其他分享> > Promise

Promise

作者:互联网

      new Promise((resolve) => {
        setTimeout(() => {
          resolve()
        }, 1000);
      }).then(() => {
        console.log('hello world');
        Message.warning('hello world');
        return new Promise((resolve,) => {
          setTimeout(() => {
            resolve()
          }, 1000);
        })
      }).then(() => {
        Message.warning('hello vuejs');
        console.log('hello vuejs');
        return new Promise((resolve) => {
          setTimeout(() => {
            resolve()
          }, 1000);
        })
      }).then(() => {
        Message.warning('final');
        console.log('final');
      })

标签:resolve,console,log,warning,Promise,hello
来源: https://www.cnblogs.com/fanwenyan/p/15838431.html