在vue中定義了elementui中的messageBox全局函數(shù)//確定消息彈框export let messageBox = (vm) => { const h = vm.$createElement; vm.$msgbox( { title: ' ', message: h('p', null, [ h('span', {'class': 'queMark'}, '?'), h('p', {'class': 'text1'}, '確定保存'), h('p', {'class': 'text2'}, '保存后則更改當頁信息,是否保存?') ]), confirmButtonText: '確認', beforeClose: (action, instance, done) => { if (action === 'confirm') { done(); } else { done(); } } });};在組件中調(diào)用//刪除 handleDelete: function () { let flag = messageBox(this); console.log(flag) },但是怎么能夠取到點擊確定或者取消的值呢?輸出一直是undefined;用return也不行,求高手指教
elementUI中MessageBox的問題
繁星coding
2019-03-05 09:13:50