0👍
The callback is on a different scope…this should work
methods: {
viewBooks: function() {
let self = this;
axios.get('/books.json')
.then(res=>{
self.bookList = res.data.bookList;
})
.catch(error=>{
console.log(error);
});
}
There’s also a different answer here
- [Vuejs]-Vue.js Use a component within another on page via routes
- [Vuejs]-Semantic UI dropdown value getting retained, when the table row is deleted
Source:stackexchange.com