首页 > 移动平台 > 详细

vue 点击按钮事件,采用axios异步获取数据后,页面没有更新数据

时间:2020-05-26 09:31:29      阅读:253      评论:0      收藏:0      [点我收藏+]
            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);
                });
              this.no_id = ‘2222‘;
             
               setTimeout(()=>{
                 this.show = true
               },200)
              

            }

  

vue 点击按钮事件,采用axios异步获取数据后,页面没有更新数据

原文:https://www.cnblogs.com/weilianguang/p/12963239.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!