[Vuejs]-Vue: The best practice to change value in the component nested in the Vue Router using Vuex

0👍

use computed

const Foo = { 
    store:store,
    computed: {
        myNumber () {
            return this.$store.state.testNumber
        }
    }
    template: '<div>{{myNumber}}</div>' ,
}

Leave a comment