Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

How to handle vuex-class error #178

Open
choisohyun opened this issue Mar 13, 2022 · 0 comments
Open

How to handle vuex-class error #178

choisohyun opened this issue Mar 13, 2022 · 0 comments

Comments

@choisohyun
Copy link

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",

Screen Shot 2022-03-13 at 11 42 19

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant