We’re currently looking at how we handle state updates from custom components, in conjunction with implementing Vuex.
With .sync it automatically creates an @update handler which sets the local state to the received value:
<component name="foo" :value.sync="value"></component>
However, a Vuex store requires changes to be comit()ted.
Does this mean that sync is fundamentally incompatible with Vuex mapGetters(), or is there a workaround?
Right now, we do the following:
<component name="foo" :value="value" @change="onChange"></component>
onChange (name, value) {
this.$store.commit('path/' + name, value)
}
Are we on the right path?
(Saying that, if we are on the right lines, we could write our own directive to do just this, right?)