ant-design vue 倒计时关闭弹框

2020-12-09  本文已影响0人  Rose_yang
  countDown (data) {
      let secondsToGo = 2
      let modal = null

      modal = this.$success({
        title: '修改成功',
        content: '已成功修改信息',
        centered: true
      })

      const interval = setInterval(() => {
        secondsToGo -= 1
      }, 1000)
      setTimeout(() => {
        clearInterval(interval)
        modal.destroy()

        // do something
      }, secondsToGo * 1000)
    },
上一篇 下一篇

猜你喜欢

热点阅读