【发布时间】:2016-01-06 12:36:21
【问题描述】:
您好,我收到此错误: Uncaught (in promise) TypeError: this.$set is not a function
这里是代码:
export default {
data: function() {
return { movies: '' }
},
ready: function() {
this.showMovies()
},
methods: {
showMovies: function() {
this.$http.get(config.api.url + '/movies').then(function (response) {
this.$set('movies', response.data)
})
}
}
}
【问题讨论】:
-
解决者:
this.$http.get(config.api.url + '/movies/geners', function(geners) { this.$set('geners', geners) })
标签: vue.js