I need to load a different version of state based on a data
variable in the root component.
App.vue:
export default {
store : store,
name: 'app',
data() {
clientId : 1
}
}
store.js:
export const store = new Vuex.Store({
state : {
clientConfig : clientConfig
});
And the clientConfig
would be store in a separate file.
What is the best way to achieve a dynamic/programmatic loading of the Vuex state based on some input to the initial Vuejs App?
Thanks!
clientConfig
to your store, and usegetters
to get config corresponding toclientId
– ittusif client = x {get.config.a}
right or am I missing something? – dendogclientId
invuex
also. Then just read data fromvuex
store – ittus