전역변수를 사용해야 하는 경우, rootgetters, rootstate를 사용하여
다른 모듈에 있는 내용을 사용할 수 있다.
그러나 이는 3번까지 밖에 안된다.
따라서 3번만 rootgetter, rootstate를 사용하고 다른 방식으로 접근해야한다.
Accessing Global Assets in Namespaced Modules#
If you want to use global state and getters, rootState and rootGetters are passed as the 3rd and 4th arguments to getter functions, and also exposed as properties on the context object passed to action functions.
To dispatch actions or commit mutations in the global namespace, pass { root: true } as the 3rd argument to dispatch and commit.