vue寫一個審核(通過、拒絕)需求。拒絕需要二次確認,填寫拒絕理由。類似poromt(),我想把所有邏輯都寫在點擊拒絕時觸發(fā)的函數(shù)里,因為可以傳入點擊時所需審核的人id,問題是我著么才能等二次確認之后再執(zhí)行之后的代碼呢?好像自己寫的poromt()實現(xiàn)不了。貼上代碼 //審核團隊,拒絕還是通過 chooseTeam(operation, id) { //alert("xxx") var params = { sessionId: this.sessionId, operation: operation, reason: "" }; if (params.operation == 2) { this.showpop = true; //顯示二次確認框,輸入理由后點擊確認再發(fā)送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 }
大牛們,幫我整理下邏輯。
紅糖糍粑
2019-03-13 18:15:40