效果圖:
代碼:
// 安裝
# Vue 1.x
npm install mint-ui@1 -S
# Vue 2.0
npm install mint-ui -S
// 引入全部組件
import Vue from 'vue';
import Mint from 'mint-ui';
Vue.use(Mint);
// 按需引入部分組件
import { Cell, Checklist } from 'mint-ui';
Vue.component(Cell.name, Cell);
Vue.component(Checklist.name, Checklist);
//刪除彈框
handledelete(){
this.$messagebox({
title: '提示',
message: '確定刪除該選項嗎',
showCancelButton: true,
confirmButtonText:"確定",
cancelButtonText:"取消"
}).then(action => {
if(action == 'confirm'){
console.log('確定')
}else{
console.log('取消')
}
})
}
mint-ui官網鏈接:http://mint-ui.github.io/docs/#/en2/message-box