首先,附Message Box原API文档:http://mint-ui.github.io/docs/#/en2/message-box
1、实现效果图:
2、代码
//html代码 <div class="btn" style="clear:both;"> <a href="javascript:void(0);" class="largin-btn primary" @click="handleClick">点击</a> </div> //js代码 export default { data() { return { } }, methods: { handleClick() { this.$messagebox({ title:'标题', message:'描述文字描述文字', showCancelButton:true, confirmButtonText:'是', cancelButtonText:'否', }).then(action => { if(action === 'confirm') { console.log('confirm') }else { console.log('cancel') } }) } }, }