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

运行效果截屏:

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