`${action}`可以捕获用户选择cancel还是confirm,然后进行相应操作
官方文档:http://element-cn.eleme.io/#/zh-CN/component/message-box
test (file) { this.$alert('确认从服务器删除jar包?', '提示', { confirmButtonText: '确定', callback: action => { if (`${action}` === 'confirm') { console.log('del jar...') this.delJar(file) // msg this.$message({ type: 'info', message: file.name + ' 已删除!' }) } // reload data this.getJars() } })
}
---
开心工作,认真生活;回望来时路,脚印三两,笑声无数...
开心工作,认真生活;回望来时路,脚印三两,笑声无数...