index.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {},
getters: {},
mutations: {},
actions: {}
})
app.js
import Vue from 'vue'
import store from './index'
// Can someone explain the role of the store parameter in the Vue instance?
const app = new Vue({
store
})
app.$mount('#app')
I've noticed a similar structure used for setting up Vue Router instances as well.