vue 确认删除的提示框


image-20201104161736428

image-20201104161820820

需要在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('确认了删除')


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM