使用vue获取豆瓣电影的某个电影详细信息,数据已经获取成功,average属性也在页面上显示成功,但是控制台却报错。
{{detail.title}}
({{detail.original_title}})
{{detail.rating.average}}分
暂无评分
export default {
data() {
return {
movieID: '',
detail: []
}
},
created: function() {
var that = this;
this.$http.get('http://127.0.0.1:8081/movie/subject/' + that.$route.params.id)
.then(function(response) {
that.detail = response.data;
}).catch(function(error) {
console.log(error);
});
},
mounted: function() {
this.movieID = this.$route.params.id;
}
}