[Vuejs]-DataTables new row won't add to table

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 );
            });

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.

Leave a comment