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