@@ -121,9 +121,9 @@ export function _createProxy<T>(cls: T, $store: any, namespacedPath = "") {
121121 const classPath = getClassPath ( VuexClass . prototype . __namespacedPath__ ) || toCamelCase ( VuexClass . name ) ;
122122 const { state, mutations, actions, getters, modules } = extractVuexModule ( VuexClass ) [ classPath ] ;
123123
124- createGettersAndMutationProxyFromState ( { cls : VuexClass , proxy, state, $store, namespacedPath, maxDepth : 7 } ) ;
125- createExplicitMutationsProxy ( VuexClass , proxy , $store , namespacedPath ) ;
124+ createGettersAndMutationProxyFromState ( { cls : VuexClass , proxy, state, $store, namespacedPath, maxDepth : 1 } ) ;
126125 createGettersAndGetterMutationsProxy ( { cls : VuexClass , mutations, getters, proxy, $store, namespacedPath } ) ;
126+ createExplicitMutationsProxy ( VuexClass , proxy , $store , namespacedPath ) ;
127127 createActionProxy ( { cls : VuexClass , actions, proxy, $store, namespacedPath } ) ;
128128 createSubModuleProxy ( $store , VuexClass , proxy , modules ) ;
129129
@@ -298,7 +298,7 @@ function createGettersAndMutationProxyFromState({ cls, proxy, state, $store, nam
298298 if ( currentField . length && ! currentField . endsWith ( "." ) ) currentField += "." ;
299299 const path = currentField + field ;
300300
301- if ( maxDepth === 0 || typeof value !== "object" ) {
301+ if ( typeof value !== "object" ) {
302302 Object . defineProperty ( proxy , field , {
303303 get : ( ) => {
304304 // When creating local proxies getters doesn't exist on that context, so we have to account
@@ -341,7 +341,9 @@ function createExplicitMutationsProxy( cls :VuexModuleConstructor, proxy :Map, $
341341
342342 const mutations = cls . prototype . __mutations_cache__ . __explicit_mutations__ ;
343343 const commit = cls . prototype . __store_cache__ ? cls . prototype . __store_cache__ . commit : $store . commit ;
344- namespacedPath = cls . prototype . __namespacedPath__ . length ? cls . prototype . __namespacedPath__ + "/" : namespacedPath ;
344+ namespacedPath = refineNamespacedPath (
345+ cls . prototype . __namespacedPath__ . length ? cls . prototype . __namespacedPath__ + "/" : namespacedPath
346+ ) ;
345347
346348 for ( let field in mutations ) {
347349 proxy [ field ] = ( payload :any ) => commit ( namespacedPath + field , payload )
@@ -359,6 +361,8 @@ function createGettersAndGetterMutationsProxy({ cls, getters, mutations, proxy,
359361 $store . __internal_mutator__ = mutations . __internal_mutator__ ;
360362 }
361363
364+ namespacedPath = refineNamespacedPath ( namespacedPath ) ;
365+
362366 for ( let field in getters ) {
363367
364368 if ( $store === undefined ) continue ;
0 commit comments