代码:

<template>
<el-button type="text" @click="open">点击打开 Message Box</el-button>
</template> <script>
export default {
methods: {
open () {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
// MessageBox 的自定义类名
customClass: 'btn-cancle-right'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
// 在单页面使用不可以加scoped限制,否则不生效
<style lang="scss">
/* 可以把这个btn-cancle-right类放置到公共的样式文件中,
这样就可以只定义一次,多次重复使用啦 */
.btn-cancle-right {
.el-message-box__btns {
.el-button:nth-child(1) {
float: right;
}
.el-button:nth-child(2) {
margin-right: 10px;
background-color: #2d8cf0;
border-color: #2d8cf0;
}
}
}
</style>

图示:

最新文章

  1. MSDTC故障排除,DTCTester用法 (二)
  2. Materialize一款不错的框架(装逼必备,想想一帮渣渣们还在说bootstrap的时候,你用materialize,高端洋气,别人仰望着,同事们鄙视的看着你还能不能愉快的玩耍的时候,那种孤高的感觉!-_-//意淫结束)
  3. 如何正确地使用Entity Framework Database First
  4. [转]Net 下采用GET/POST/SOAP方式动态调用WebService C#实现
  5. iOS 控制单个控制器旋转
  6. Android设置布局背景为白色的三种方法
  7. selenium 处理浏览器多窗口
  8. C++ Prime:decltype类型指示符
  9. hdu 1078 FatMouse and Cheese_记忆搜索
  10. Ubuntu文件系统
  11. python-day18 JS正则,组件BootStrap、EasyUI、JQueryUI1,插件轮播,django
  12. 国内安装helm
  13. anaconda4.2.0
  14. HTML翻转菜单练习
  15. Eclipse添加JDK,JRE切换
  16. leecode第五十四题(螺旋矩阵)
  17. 亚马逊aws 一个实例双网卡-两个弹性ip设置
  18. .NET中低版本程序调用高版本DLL
  19. LeetCode 8 有效的括号
  20. Overcoming Life&#39;s Obstacles - ASC 2017 March 03-04

热门文章

  1. TextView 走马灯效果不生效
  2. 制造业常用KPI
  3. XAF在页面中添加按钮
  4. 1137. 第 N 个泰波那契数 (Easy)
  5. echarts饼图同时展示数量和百分比
  6. MeterSphere中dubbo接口测试分享
  7. Datax-web入门配置与启动
  8. IntelliJ IDEA2021.3破解教程【Windows10系统】
  9. 重写Collections集合的排序比较CompareTo方法
  10. 对于AF、RI、Safety from rep exposure、spec的归纳总结