[Vuejs]-Vue not updating after data change via axios

0👍

Since axios returns a promise, you either need to utilize async await

i.e.

    async add_link(domain,tag,url) {
        await axios.get('http://localhost:5000/addlink?domain='+encodeURIComponent(domain)+'&tag='+encodeURIComponent(tag)+'&url='+encodeURIComponent(url))
        this.update()
    },

or just put this.update into a then

    add_link(domain,tag,url) {
        axios.get('http://localhost:5000/addlink?domain='+encodeURIComponent(domain)+'&tag='+encodeURIComponent(tag)+'&url='+encodeURIComponent(url))
             .then( () => this.update() )

    },

Leave a comment