Skip to content

Commit 0fcc7f4

Browse files
authored
docs: add examples for getters in other namespaced modules (#1800)
1 parent 0e4d97f commit 0fcc7f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/guide/modules.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ modules: {
151151
someGetter (state, getters, rootState, rootGetters) {
152152
getters.someOtherGetter // -> 'foo/someOtherGetter'
153153
rootGetters.someOtherGetter // -> 'someOtherGetter'
154+
rootGetters['bar/someOtherGetter'] // -> 'bar/someOtherGetter'
154155
},
155156
someOtherGetter: state => { ... }
156157
},
@@ -161,6 +162,7 @@ modules: {
161162
someAction ({ dispatch, commit, getters, rootGetters }) {
162163
getters.someGetter // -> 'foo/someGetter'
163164
rootGetters.someGetter // -> 'someGetter'
165+
rootGetters['bar/someGetter'] // -> 'bar/someGetter'
164166

165167
dispatch('someOtherAction') // -> 'foo/someOtherAction'
166168
dispatch('someOtherAction', null, { root: true }) // -> 'someOtherAction'

0 commit comments

Comments
 (0)