Answers for "v-switch vuex store"

3

v-switch vuex store

import { mapState } from "vuex";

computed: {
    ...mapState(["settings"]),
    computedProperty: {
      get() {
        return this.settings.valueInState;
      },
      set(valuePassedThrough) { //the value is passed through the v-model automatically
        this.$store.dispatch(`storeAction`, valuePassedThrough);
      }
    }
}
Posted by: Guest on May-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language