How to use the vuex/dist/vuex.esm.js.Store function in vuex

To help you get started, we’ve selected a few vuex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openhab-nodes / ui-maintenance / temporary / stores / index.js View on Github external
import { Vue } from './vue.js'; // Pre-bundled, external reference
import Vuex from 'vuex/dist/vuex.esm.js';
export { mapState, mapActions } from 'vuex/dist/vuex.esm.js';
import {demoList, demoPost} from './demo';

Vue.use(Vuex);

const store = new Vuex.Store({
    modules: {
        "demo": demoList,
        "demoPost": demoPost
    }
});

export { Vue, Vuex, store };
github kjartanm / microfrontends / packages / order / src / index.js View on Github external
import OrderPizza from './OrderPizza.vue'
import Vue from 'vue/dist/vue.esm.js'
import Vuex from 'vuex/dist/vuex.esm.js'

Vue.use(Vuex);

export const store = new Vuex.Store({
    state: {
        cart: [],
        customerid: null
    },
    mutations: {
        CUSTOMERID(state, customerid) {
            state.customerid = customerid
        },
        CART(state, cart) {
            state.cart = cart
        },
    },
    getters: {
        customerid: state => state.customerid,
        cart: state => state.cart,
    },