# Alert

返回Promise

# 配置项

param type default desc
title string '提示'
message string ''
okText string '确定'
html string '' 可以传入html片段 如若传入,将替换掉message内容
wait function null 支持异步式调用 传入next参数 并在函数体中调用next()即可实现异步式调用

# 基础用法

this.$dialog.alert({
  title: '提示',
  message: '请登陆后再试'
})

# 异步关闭用法

this.$dialog.alert({
  message: '点击确定将发送请求',
  wait: async next => {
    await this.$axios.get('xxx') // 请求开始按钮上的文字将变为一个小旋转菊花
    next() // 请求结束后将结束loading状态
  }
})

// 请求失败实例
export default {
  methods: {
    async syncAlertFail () {
      this.dialogX.alert({message: '异步关闭的弹窗', wait: next => {
        let res = await request()
        // 请求失败的话 重新调用一遍自身就可以
        if (res.code !== 200) {
          await this.dialogX.alert({message: '请求失败'})
          this.syncAlertFail()
        }
        next()
      }})
    }
  }
}