1import { mapState } from "vuex";
2
3computed: {
4 ...mapState(["settings"]),
5 computedProperty: {
6 get() {
7 return this.settings.valueInState;
8 },
9 set(valuePassedThrough) { //the value is passed through the v-model automatically
10 this.$store.dispatch(`storeAction`, valuePassedThrough);
11 }
12 }
13}
1// ...
2computed: {
3 message: {
4 get () {
5 return this.$store.state.obj.message
6 },
7 set (value) {
8 this.$store.commit('updateMessage', value)
9 }
10 }
11}
12