VuxUI使用歷程:【002】Vux組件使用之Alert組件

Vux:Alert組件

import { Alert } from 'vux'

export default {
  components: {
    Alert
  }
}

使用場景Demo

第一步:將組件引用並且註冊到對象中

第二步:綁定事件

第三步:編寫事件代碼(個人Demo中的代碼片段)

showModule() {
      if (this.payTips) {
        window.location.href = this.payurl;
      } else {
        this.payTips = true;
        AlertModule.show({
          title: "請支付對應金額",
          content: "如支付與訂單不相符金額會造成支付失敗!緊急情況請聯繫客服",
          onShow() {
            console.log("Module: I'm showing");
          },
          onHide() {
            console.log("Module: I'm hiding now");
          }
        });
      }
    }

運行效果截屏:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章