ElementDragMessageBox
ElementMessageBox重写使其能够进行拖动
创建Element项目
import MessageBox from '@/components/MessageBox'
MessageBox.confirm('检测到未保存的内容,是否在离开页面前保存修改?', '确认信息', {
distinguishCancelAndClose: true,
confirmButtonText: '保存',
cancelButtonText: '放弃修改'
})
.then(() => {
this.$message({
type: 'info',
message: '保存修改'
})
})
.catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '放弃保存并离开页面'
: '停留在当前页面'
})
})