在ElementUI的 MessageBox 弹框 进行api接口请求


  confirmDelete(row) {
      let that = this;
      let data = {
        id: row
      };
      that.$axios
        .post(api.destroymodule, data)
        .then(res => {
          if (res.data.success == true) {
            this.$message({
              message: "删除成功",
              type: "success",
              duration:500
            });
          }
        })
        .catch(error => {
          console.log(error);
           this.$message({
          message: '删除失败',
          type: 'error'
        });
        });
    },
    async remover_handleClick(row) {
      let that = this;

      this.$confirm("此操作将永久删除该模块, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(async () => {
          let msgRet = await this.confirmDelete(row.id);
        })
        .catch(() => {
          console.log("cancel");
        });
    },

 


免责声明!

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



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