element 的 Notification 通知,自定义内容

通知事件:

// 商户后台通知
MerchantBackgroundNotice() {
    // 禁止消息通知弹出多条
    if(this.notifyInstance) {
        this.notifyInstance.close();
    }const h = this.$createElement; // 创建文本节点
    this.notifyInstance = this.$notify({
        showClose: false, // 禁止关闭按钮出现
        title: '订单通知', // 标题
        position: 'top-left', // 消息通知位置
        type: 'success', // 带有成功性的通知
        duration: 0, // 不自动关闭
        dangerouslyUseHTMLString: true, // 允许自定义HTML片段
        message: h(
            "div",
                {
                    style:"padding-top: 10px;height: 90px;",
                },
            [
                h("div", 
                    {
                        style: "height: 45px;",
                    },
                    '当前订单已通知商户!'
                ),
                h(
                    "div",
                    {
                        class: 'close_notify', // 自定义class
                        // style: "",
                        on: {
                            click: this.close_notify, // 确定按钮的点击事件
                        },
                    },
                    "确定"
                ),
            ]
        ),
    });
},
//关闭消息提示
close_notify() {
    this.notifyInstance.close();
},
// 消息通知显示位置(居中).el-notification.left{
    top: 15% !important;
    left: 45% !important;
    /* transform: translate(-50%, -50%) !important; */
}
.close_notify{
    color: #fff;
    cursor: pointer;
    width: 60px;
    height: 30px;
    line-height: 30px;
    background: rgb(64, 158, 255);
    text-align: center;
    position: absolute;
    bottom: 20px;
    right: 30px;
}

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值