0👍
You are using this to refer to an object, so you are limited to Axios scope. Instead you can use a variable to store a reference to main object, in your case adminVerses and then use $data to set or fetch the data attributes.
Example :
let vm = this;
axios({
...
}).then((res) => {
vm.$data.getVerses.push( res.data.verse );
});
- [Vuejs]-Issue with geochart library in vue-chartkick npm package
- [Vuejs]-Problem with toggling a GSAP animation in a watcher that is watching vuex state
0👍
open your vue devtools and check if getVerses gets the right data
0👍
The push on the array isn’t responsive, so the vue doesn’t know it needs to update the view. The array setter is responsive, so:
this.getVerses = this.getVerses.concat(res.data.verse)
will do the trick.
- [Vuejs]-SyntaxError: Unexpected token … in serialport in node_modules
- [Vuejs]-Production build customization options. Vue-cli 3
Source:stackexchange.com