axios 里面 then 默认写的function里面没有this,改成箭头函数后就可以用this了

,methods:{
        loadJson:function(){
            //this.jsonTest = "jjj"
          this.$http.get('http://localhost:3003/news/1')
            .then((response) => {
              //console.log(response.data.title);
              this.jsonTest = response.data.title;
              //console.info(this)
            })
            .catch(function (error) {
              console.log(error);
            });
        }
      }
原文地址:https://www.cnblogs.com/pengchenggang/p/10238713.html