Icontem

File: app/components/test-counter-hot/store/index.js

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy  >  Vuex Examples  >  app/components/test-counter-hot/store/index.js  >  Download  
File: app/components/test-counter-hot/store/index.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Vuex Examples
Example apps using Vuex state management pattern
Author: By
Last change:
Date: 2 years ago
Size: 683 bytes
 

Contents

Class file image Download
define([
    'vue',
    'vuex',
    'app/components/test-counter-hot/store/getters',
    'app/components/test-counter-hot/store/actions',
    'app/components/test-counter-hot/store/mutations',
], function (Vue, Vuex, getters, actions, mutations) {

    Vue.use(Vuex);

    // root state object.
    // each Vuex instance is just a single state tree.
    var state = {
        count: 0,
        history: []
    }

    // A Vuex instance is created by combining the state, mutations, actions,
    // and getters.
    var store = new Vuex.Store({
        state: state,
        getters: getters,
        actions: actions,
        mutations: mutations
    })
    
    return store;

});