@@ -116,7 +116,7 @@ export function setupPlugin (api: DevtoolsApi, app: App, Vue) {
116
116
api . on . getInspectorState ( ( payload ) => {
117
117
if ( payload . inspectorId === VUEX_INSPECTOR_ID ) {
118
118
const modulePath = payload . nodeId
119
- const module = getStoreModule ( store . _modules , modulePath )
119
+ const { module, getterPath } = getStoreModule ( store . _modules , modulePath )
120
120
if ( ! module ) {
121
121
return
122
122
}
@@ -126,7 +126,7 @@ export function setupPlugin (api: DevtoolsApi, app: App, Vue) {
126
126
payload . state = formatStoreForInspectorState (
127
127
module ,
128
128
store . _makeLocalGettersCache ,
129
- modulePath ,
129
+ getterPath ,
130
130
)
131
131
}
132
132
} )
@@ -498,12 +498,20 @@ function transformPathsToObjectTree (getters) {
498
498
function getStoreModule ( moduleMap , path ) {
499
499
const names = path . split ( VUEX_MODULE_PATH_SEPARATOR ) . filter ( ( n ) => n )
500
500
return names . reduce (
501
- ( module , moduleName , i ) => {
502
- const child = module ? module [ moduleName === VUEX_ROOT_PATH ? 'root' : moduleName ] : null
501
+ ( { module, getterPath } , moduleName , i ) => {
502
+ const child = module [ moduleName === VUEX_ROOT_PATH ? 'root' : moduleName ]
503
503
if ( ! child ) return null
504
- return i === names . length - 1 ? child : child . _children
504
+ return {
505
+ module : i === names . length - 1 ? child : child . _children ,
506
+ getterPath : child . _rawModule . namespaced
507
+ ? getterPath
508
+ : getterPath . replace ( `${ moduleName } ${ VUEX_MODULE_PATH_SEPARATOR } ` , '' ) ,
509
+ }
510
+ } ,
511
+ {
512
+ module : path === VUEX_ROOT_PATH ? moduleMap : moduleMap . root . _children ,
513
+ getterPath : path ,
505
514
} ,
506
- path === VUEX_ROOT_PATH ? moduleMap : moduleMap . root . _children ,
507
515
)
508
516
}
509
517
0 commit comments