0👍
This is a way to do it:
component.vue
import { getCurrentInstance } from 'vue';
setup() {
const _instance = getCurrentInstance();
const { $store } = _instance.appContext.app.config.globalProperties;
},
createStore
"use strict";
import { createStore } from 'vuex';
// Stores
import moduleA from '@/store/moduleA.js';
import moduleB from '@/store/moduleB.js';
export const store = createStore({
strict: true,
modules: {
moduleA,
moduleB,
}
});
Source:stackexchange.com