Hi I am geting this error: Uncaught (in promise) TypeError: this.$set is not a function
And here is the code:
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)
})
}
}
}
The reason why
this.$set
is not a function in your example code is becausethis
doesn't refer to Vue ViewModel instance anymore.To make code you've posted working, you need to keep reference to it: