[Vuejs]-Vuex – Model nested modules' dependency

0👍

Just going through a similar issue to this and have trying different things due to lack of apparent documentation on this issue. From experimentation, the following approach seems to work:

export interface RootState {
  moduleA: ModuleAState;
  moduleB: ModuleBState;
}

export interface ModuleAState {
  valueA: string;
}

export interface ModuleBState {
 valueB: string;
}

This allows you to accessed the namespaced state using state.moduleA.valueA

Leave a comment