store,
install (Vue, options) {
Vue.prototype.$store = store
}
}
...
store.js
.....
import Vue from 'vue'
import Vuex from 'vuex'
import invoice from './modules/invoice'
import createLogger from 'vuex/dist/logger'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export default new Vuex.Store({
modules: {
invoice
},
strict: false,
plugins: debug ? [createLogger()] : []
})
......
подключаю в компонентах
....
import store from '@/plugin/storePlugin'
Vue.use(store)
..
не кидай портянки
Обсуждают сегодня