I have a Vuex store, which I'm injecting into my instance:
import store from '../store';
const mainNav = new Vue({
el: '#main-nav',
store,
components: { NavComponent }
});
And I'm creating a computed property from that store in the component:
computed: {
isWide() {
return this.$store.state.nav.type === 'wide';
}
}
This does create the this.isWide
property for the template on component initialization, but when the store value is updated, the component doesn't register this - the old value is still on the template.
What am I doing wrong here?