File tree Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 121
121
May impact performance or cause crashes
122
122
</template >
123
123
</VueFormField >
124
+
125
+ <VueFormField >
126
+ <template #title >
127
+ Group getters by module
128
+ <NewTag :version =" 2" />
129
+ </template >
130
+ <VueSwitch v-model =" $shared.vuexGroupGettersByModule" >
131
+ Enable
132
+ </VueSwitch >
133
+ </VueFormField >
124
134
</div >
125
135
</template >
126
136
Original file line number Diff line number Diff line change 8
8
import GlobalPreferences from ' ./GlobalPreferences.vue'
9
9
import { mapState } from ' vuex'
10
10
11
- export const SETTINGS_VERSION = 2
11
+ export const SETTINGS_VERSION = 3
12
12
export const SETTINGS_VERSION_ID = ' vue-devtools-settings-version'
13
13
14
14
export default {
Original file line number Diff line number Diff line change @@ -139,6 +139,27 @@ const getters = {
139
139
res . getters = data . getters
140
140
}
141
141
142
+ if ( SharedData . vuexGroupGettersByModule && res . getters ) {
143
+ const getterGroups = { }
144
+ const keys = Object . keys ( res . getters )
145
+ keys . forEach ( key => {
146
+ const parts = key . split ( '/' )
147
+ let parent = getterGroups
148
+ for ( let p = 0 ; p < parts . length - 1 ; p ++ ) {
149
+ const part = parts [ p ]
150
+ parent = parent [ part ] = parent [ part ] || {
151
+ _custom : {
152
+ value : { } ,
153
+ abstract : true
154
+ }
155
+ }
156
+ parent = parent . _custom . value
157
+ }
158
+ parent [ parts . pop ( ) ] = res . getters [ key ]
159
+ } )
160
+ res . getters = getterGroups
161
+ }
162
+
142
163
return res
143
164
} ,
144
165
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ const internalSharedData = {
15
15
editableProps : false ,
16
16
logDetected : true ,
17
17
vuexNewBackend : false ,
18
- vuexAutoload : false
18
+ vuexAutoload : false ,
19
+ vuexGroupGettersByModule : true
19
20
}
20
21
21
22
const persisted = [
@@ -27,6 +28,7 @@ const persisted = [
27
28
'logDetected' ,
28
29
'vuexNewBackend' ,
29
30
'vuexAutoload' ,
31
+ 'vuexGroupGettersByModule' ,
30
32
'timeFormat'
31
33
]
32
34
You can’t perform that action at this time.
0 commit comments