`${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()
  }
  })
}

 

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-07-06
  • 2022-12-23
  • 2021-10-20
  • 2021-07-26
  • 2021-11-06
相关资源
相似解决方案