element中this.$confirm的用法,element 您所在的位置:网站首页 点击右上角在浏览器中打开怎么关掉 element中this.$confirm的用法,element

element中this.$confirm的用法,element

2024-01-19 23:21| 来源: 网络整理| 查看: 265

项目场景:

element-ui MessageBox 弹框怎么隐藏右上角的关闭按钮呢? element-ui MessageBox 弹框怎么设置点击空白处不关闭? 如何隐藏this. c o n f i r m 右 上 角 的 x ? t h i s . confirm右上角的x? this. confirm右上角的x?this.confirm怎么将右上角的x屏蔽掉?

在这里插入图片描述

问题描述

有一些业务需要让弹窗一直显示,除非已经点击了确认按钮,这时候就需要对this.$confirm进行处理,既不可以点击右上角x将弹窗关闭,也不可以点击其它空白处关闭弹窗,直接上代码。

this.$confirm('进行企业实名认证后才可开通短信服务!', '提示', { confirmButtonText: '前往认证', //确认按钮的文字显示 type: 'warning', center: true, //文字居中显示 showCancelButton: false, //不显示取消按钮 showClose: false, //是否显示右上角的x closeOnClickModal: false, //是否可以点击空白处关闭弹窗 }) .then(() => { window.location.href = '#/main/iam/authentication'; }) .catch(() => { });

在这里插入图片描述

代码分析:

确定按钮的文本内容:

confirmButtonText: ‘确定’,

取消按钮的文本内容:

cancelButtonText: ‘取消’,

是否显示取消按钮:

showCancelButton: false,

是否显示确定按钮:

showConfirmButton: true,

文字居中显示:

center: true,

MessageBox 是否显示右上角关闭按钮:

showClose: false,

confirm提示框 设置点击空白处不关闭: 是否可通过点击遮罩(点击空白处)关闭 MessageBox:

closeOnClickModal: false,

参考element官网:https://element.eleme.io/2.15/#/zh-CN/component/message-box

在这里插入图片描述 用法位置:

在这里插入图片描述



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

      专题文章
        CopyRight 2018-2019 实验室设备网 版权所有