F
F
flafy42019-12-14 13:19:31
JavaScript
flafy4, 2019-12-14 13:19:31

How to write multiple vuex objects into one?

// store1.js
const store1 = {
  state: {},
  getters: {},
  mutations: {},
  actions: {},
};
export default store1

// store2.js
const store2 = {
  state: {},
  getters: {},
  mutations: {},
  actions: {},
};
export default store2

//store_index.js
import store1 from './store1'
import store2 from './store2'

const store = new Vuex.Store('Поместить store1 и store2 сюда');

//const store = new Vuex.Store(store1, store2); Такой вариант не работает

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Barkowski, 2019-12-14
@flafy4

I advise you to read this article:
https://vuex.vuejs.org/ru/guide/modules.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question