-
定义自定义类名 customClass: "close_confirm",
//关闭
onClose() {
this.$confirm("是否退出程序?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
customClass: "close_confirm",
type: "warning",
})
.then(() => {
})
.catch(() => {});
},
- 设置css样式
<style lang="less">
/* 交换 确定 和 取消 按钮的位置 */
.close_confirm .el-message-box__btns {
display: flex;
flex-direction: row-reverse;
.el-button {
margin: 0 0.5rem;
}
}
</style>
注意
不是写在scoped 里面