반응형
등록된 모든 Vuex 모듈을 가져오는 방법
모든 Vuex 모듈에서 반복할 수 있는 방법이 있습니까?모듈 이름을 이렇게 등록했습니다.
$store.registerModule('module-xyz', module);
이제 그들 모두의 명단을 얻을 수 있는 방법은 없을까?
문서화되어 있지 않지만 모든 모듈은_modules
속성:
console.log(this.$store._modules.root._children);
또한 다음과 같이 모듈의 존재 여부를 확인할 수 있습니다.
console.log(this.$store.hasModule('module-xyz'));
언급URL : https://stackoverflow.com/questions/66139527/how-to-get-all-registered-vuex-modules
반응형
'itsource' 카테고리의 다른 글
C에서의 변수 선언 배치 (0) | 2022.08.31 |
---|---|
FileInputStream을 사용할 때 이상적인 버퍼 사이즈는 어떻게 결정합니까? (0) | 2022.08.31 |
NuxtJs 응용 프로그램에서 Vue.set()을 사용하는 방법 (0) | 2022.08.31 |
$NON-NLS-1$의 의미는 무엇입니까? (0) | 2022.08.31 |
vue2-Google-Maps, beforeEnter() 루트 가드를 사용한gmapapi 접근 (0) | 2022.08.30 |