Open choisohyun opened 2 years ago
I am currently using vuex and vuex-class together. However, there is an error saying that the module cannot be found in the place using namespace, which is the vuex-class syntax. How to avoid errors while using vuex-class?
"vuex": "^3.6.2", "vuex-class": "^0.3.2",
Below are some codes of the namespace usage part.
const bottomNavStore = { namespaced: true, state: { bottomNavigation: null, }, mutations: { SET_BOTTOM_NAV: function(state: BottomNavState, bottomNav: BottomNavObject) { state.bottomNavigation = bottomNav; }, UNSET_BOTTOM_NAV: function(state: BottomNavState) { state.bottomNavigation = null; }, }, actions: {}, getters: { getBottomNav: function(state: BottomNavState) { return state.bottomNavigation; }, }, }; export default bottomNavStore; ... import * as requireModules from './modules'; export default new Vuex.Store({ strict: import.meta.env.VITE_NODE_ENV !== 'production', modules: requireModules, ...root, }); ... const bottomNav = namespace('bottomNav'); @bottomNav.Getter('getBottomNav') private readonly hasBottomNav;
please check.
I am currently using vuex and vuex-class together.
However, there is an error saying that the module cannot be found in the place using namespace, which is the vuex-class syntax.
How to avoid errors while using vuex-class?
Below are some codes of the namespace usage part.
please check.