我的问题很简单,我想在运行时分配数据并在vue实例中再次获取它们
data() {
return {
panels:[],
};
},
created() {
this.fetchPanels();
//console.log(this) , i can find panels already assigned in this instance
//console.log(this.panels) , it gives me zero array
},
methods: {
fetchPanels() {
this.$http
.get(Shared.siteUrl+"/api/" + this.category_title + "/panels")
.then(function(response) {
this.panels = response.body.data;
});
},
一只甜甜圈
相关分类