Answer the question
In order to leave comments, you need to log in
How to make multiple Vue with your Store?
Hello.
I want to inject vue into a page, in multiple instances. Everything is connected and working, but the Vuex store turned out to be common. How can you split a store and make it within each Vue instance?
Answer the question
In order to leave comments, you need to log in
If you use the Vuex.Store constructor more than once, you won't be jailed for it. So nothing prevents you from creating several different stores, one for each instance of Vue.
And if their structure should be identical - make a function that will create a store and instead of
new Vue({
store: store,
...
new Vue({
store: createStore(),
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question