[Vuejs]-Route doesn't populate data when page is refreshed

1👍

The fix is that these properties should be declared as computed properties, instead of returning them in the data object:

in Account.vue:

module.exports = {
data: function() {
return {

    }
},
computed: {
    firstname: function() { return this.$store.state.user.firstname },
    lastname: function() { return this.$store.state.user.lastname }
},

Leave a comment