vue 點擊按鈕事件,采用axios異步獲取數據后,頁面沒有更新數據


            showPopup(value) {
                let _this = this;  //這個是注意點 需要先把this對象放到變量里,不能直接在axios里用this對象
              axios.post("{:url('index/index/order_detail')}", {
                id: value,        // 參數 firstName
              })
                .then(function (response){
                 
                 // console.log(response.data);
                  _this.detail.no_id = response.data.no_id;
                  _this.detail.title = response.data.title;
                  _this.detail.name = response.data.name;
                  _this.detail.phone = response.data.phone;
                  _this.detail.final_price = response.data.final_price;
                  _this.detail.is_pay = response.data.is_pay;
                  _this.detail.status = response.data.status;
                  _this.detail.addtime = response.data.addtime;
                  
                })
                .catch(function (error) {
                  console.log(error);
                });
             
               setTimeout(()=>{
                 this.show = true
               },200)
              

            }

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM