Daniel, help me sort out the logic.

vue writes a review (pass, reject) requirement. Rejection requires a second confirmation. Fill in the reasons for rejection. Like poromt (), I want to write all the logic in the function that is triggered when I click reject, because you can pass in the id, of the person you need to review when you click. The question is, how can I wait for a second confirmation before executing the code? It seems that the poromt () written by myself can not be realized.
paste the code

 //

      chooseTeam(operation, id) {
        //alert("xxx")
        var params = {
          sessionId: this.sessionId,
          operation: operation,
          reason: ""
        };

        if (params.operation == 2) {
          this.showpop = true;  //ajax
          
        }
       

        this.$http("post", "/team/" + id, params).then((res) => {
          res = res.data;
          if (res.result == 1 && res.data) {
            this.getContent();
          }
        });
      }
      ,
      resure(string,callback) {
        if(string =="yse"){
          return true
        }else if(string=="no"){

          return false
        }
Jun.10,2021

in the callback function


you can write a closure to return a function a, fix the id, and then wait for click OK to run a


use the Modal component + Promise, it's not very complicated.

Menu