//toolbar.js, test.js为某个vuex的module
import { createNamespacedHelpers, mapGetters, mapActions } from "vuex";
const { mapGetters:toolBarMapGetters, mapActions:toolBarMapActions } = createNamespacedHelpers('toolbar');
const { mapGetters:testMapGetters, mapActions:testMapActions } = createNamespacedHelpers('test');
...mapGetters(['get'])
...toolBarMapGetters(['toolBarGet'])
...testMapGetters(['testGet'])
...mapActions(['actions'])
...toolBarMapActions(['toolBarActions'])
...testMapActions(['testActions'])
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12