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://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)
生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
https://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)