$confirm提示框的按鈕默認(rèn)順序是取消、確定,想要將兩個(gè)按鈕的順序調(diào)換,思路是將取消按鈕向右浮動(dòng)即可。
1、定義css
//設(shè)置取消按鈕向右浮動(dòng),左magin為10px,即與確定按鈕間距為10px
.btn-custom-cancel {
float: right;
margin-left: 10px;
}
2、在使用$confirm提示框時(shí)設(shè)置按鈕樣式
this.$confirm('此操作將永久刪除該文件, 是否繼續(xù)?','提示',
{
cancelButtonClass: 'btn-custom-cancel',
closeOnClickModal: false
}).then(() => {
// TODO
})