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)
              

            }

  

posted @ 2020-05-26 08:22  微联云  阅读(2624)  评论(0编辑  收藏  举报