html messagebox确定取消,Element MessageBox弹框的具体使用
组件—弹框
消息提示
点击打开 Message Box
export default {
methods: {
open() {
this.$alert('这是一段内容', '标题名称', {
confirmButtonText: '确定',
callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
}
});
}
}
}
确认消息
点击打开 Message Box
export default {
methods: {
open() {
this.$alert('这是一段内容', '标题名称', {
confirmButtonText: '确定',
callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
}
});
}
}
}
提交内容
点击打开 Message Box
export default {
methods: {
open() {
this.$prompt('请输入邮箱', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '邮箱格式不正确'
}).then(({ value }) => {
this.$message({
type: 'success',
message: '你的邮箱是: ' + value
});
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
}
}
}
自定义
点击打开 Message Box
export default {
methods: {
open() {
const h = this.$createElement;
this.$msgbox({
title: '消息',
message: h('p', null, [
h('span', null, '内容可以是 '),
h('i', { style: 'color: teal' }, 'VNode')
]),
showCancelButton: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '执行中...';
setTimeout(() => {
done();
setTimeout(() => {
instance.confirmButtonLoading = false;
}, 300);
}, 3000);
} else {
done();
}
}
}).then(action => {
this.$message({
type: 'info',
message: 'action: ' + action
});
});
}
}
}
使用 HTML 片段
点击打开 Message Box
export default {
methods: {
open() {
this.$alert('这是 HTML 片段', 'HTML 片段', {
dangerouslyUseHTMLString: true
});
}
}
}
区分取消与关闭
点击打开 Message Box
export default {
methods: {
open() {
this.$alert('这是 HTML 片段', 'HTML 片段', {
dangerouslyUseHTMLString: true
});
}
}
}
居中布局
点击打开 Message Box
export default {
methods: {
open() {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
}
全局方法
单独引用
Options
html messagebox确定取消,Element MessageBox弹框的具体使用相关推荐
- 【解决方案】element show-password弹框关闭如何将小眼睛还原
背景描述 因为我们的密码输入框是放在弹出框里的,element show-password 在弹框里打开小眼睛,关闭弹框,再打开小眼睛仍开着,感觉比较尴尬,如下: 问题: 打开小眼睛后,不刷新页面下一 ...
- vue element 确认弹框中显示图片(message里)
代码如下: ------------------- 此部分卸载Message.box内部 -----------------const weiXinUrl = require("../../ ...
- html c 中messagebox,Element-Ui组件 MessageBox 弹框
基础用法 消息提示弹框 ``` 点击打开 Message Boxexportdefault{ methods: { open() {this.$alert('这是一段内容','标题名称 ...
- js点击取消按钮关闭当前弹框_UI设计中“取消按钮”的分析详解
按钮,无论是在 Web 还是 App 上都被广泛地使用,而很少有设计师会注意到按钮当中的细节,导致在设计过程中出现一些低级的错误,使得用户在完成任务的过程中产生阻碍,无法顺利达成目的. 在许多优秀的产 ...
- 解决uni-app官方弹框popup关闭不了问题;/pages/extUI/popup/popup;uni-app弹框popup打开调用事件。unin-app弹框封装;
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210716165216781.png?x-oss-process=image/watermark,type_Zm ...
- 小程序弹框wx.showModal、wx.showActionSheet、wx.showToast
wx.showModal wx.showModal({ title: '删除图片', content: '确定要删除该图片?', showCancel: true,//是否显示取消按钮 cancelT ...
- java弹窗 触发事件_关于ElementUI中MessageBox弹框的取消键盘触发事件(enter,esc)关闭弹窗(执行事件)的解决方法...
好久没见了 在项目中遇到一个小小的需求,总结了一下! 详细我就不介绍了,相信大家用过的话,很了解.详见文档-----------> http://element-cn.eleme.io/#/zh ...
- 关于ElementUI中MessageBox弹框的取消键盘触发事件(enter,esc)关闭弹窗(执行事件)的解决方法...
好久没见了 在项目中遇到一个小小的需求,总结了一下! 详细我就不介绍了,相信大家用过的话,很了解.详见文档-----------> http://element-cn.eleme.io/#/zh ...
- 关于ElementUI中MessageBox弹框的取消键盘触发事件(enter,esc)关闭弹窗(执行事件)的解决方法
关于ElementUI中MessageBox弹框的取消键盘触发事件(enter,esc)关闭弹窗(执行事件)的解决方法 参考文章: (1)关于ElementUI中MessageBox弹框的取消键盘触发 ...
最新文章
- matlab内存管理(二)
- 支付宝支付回调异常_支付宝崩了是怎么回事 支付宝崩了部分用户使用异常现已恢复...
- 计算机网络实验(华为eNSP模拟器)——第四章 配置静态路由、动态路由
- 使用Dagger 2在GWT中进行依赖注入
- 计算机联用测定无机盐溶解热测试题,计算机联用测定无机盐溶解热
- .ai域名注册已经极具投资价值进入火爆期
- 2022年Java项目课程目录
- 三星宣布华大九天成为其晶圆代工生态系统SAFE EDA合作伙伴
- 敏捷开发系列学习总结(4)—Git管理工具sourcetree的安装
- NoticeBoard 一个仿原生UI的消息通知控件
- python web自动化测试框架搭建(功能接口)——功能测试模块
- Coherence X:将任意网站转为macOS应用
- 牛顿法的优缺点及特征
- 安装CentOS7操作系统
- 吟诗作赋不能赚钱,作诗的AI机器人的盈利之路在哪
- 4872: [Shoi2017]分手是祝愿
- 群晖NAS搭建web服务器,并发布公网可访问 2/4
- Win11安装VMware虚拟机+win10教程(主要遇到蓝屏重启问题)
- Windows 9x、2K、XP、2003注册表大全
- Unix/Linux中rc代表什么意思
热门文章
- 用 .Net WebBrowser 控件获取POST数据
- Java Selenium Actions模拟鼠标拖动dragAndDrop总结
- Dojo API略解续
- java,list遍历赋值
- centos7下配置golang1.7.1环境(自己做测试了)
- MySQL搭建主从复制 读写分离 分库分表 MyCat高可用
- mac编译php apache,在Mac OS上自行编译安装Apache服务器和PHP解释器
- JQuery实现动态插入HTML模块
- 计算机信息安全专业留学,2021美国信息安全专业排名Top50大学!
- matlab 解方程组_一文读懂MATLAB微分方程