vue 确认删除的提示框

vue 确认删除的提示框

需要在element-ui中按需导入

Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm

然后在删除方法中加入下面代码就行

/*提示消息*/
      const confirmResult = await this.$confirm('此操作将永久删除该职位, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).catch(err => err)
      /*如果用户确认打印confirm,如果用户取消显示cancel*/
      if (confirmResult !== 'confirm') {
        return this.$message.info('已取消删除!')
      }
      // console.log('确认了删除')

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2021-06-19
  • 2022-01-04
  • 2021-09-22
  • 2022-01-22
  • 2021-08-22
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案