Skip to content

Instantly share code, notes, and snippets.

@webmasterdevlin
Created March 13, 2019 03:37
Show Gist options
  • Save webmasterdevlin/5f0c8d3b3d9379107d6e5180c44503f9 to your computer and use it in GitHub Desktop.
Save webmasterdevlin/5f0c8d3b3d9379107d6e5180c44503f9 to your computer and use it in GitHub Desktop.
Vuex Store : src/store/index.js
import Vue from "vue"; // The Vue library
import Vuex from "vuex"; // The Vuex library
import heroes from "./modules/heroes"; // heroes module
import villains from "./modules/villains"; // villains is another module
Vue.use(Vuex); // using Vuex
export default new Vuex.Store({
modules: {
heroes, // can also be written like heroes:heroes
villains, // can also be written like villains:villains
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment