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');
      })

posted @ 2022-01-24 10:23  MaskerFan  阅读(22)  评论(0编辑  收藏  举报