• Skip to primary navigation
  • Skip to content
  • Skip to footer
Never test
  • About
  • Categories
  • Tags
    Vuex에서 다른 모듈의 action 호출하기
    1. Home
    2. /
    3. It
    4. /
    5. Vuex에서 다른 모듈의 action 호출하기
    YoungSeon.Ahn

    YoungSeon.Ahn

    I am an ordinary person.

    • S.Korea
    • Email
    • Twitter
    • Facebook
    • GitHub
    • Email

    Vuex에서 다른 모듈의 action 호출하기

    less than 1 minute read

    dispatch를 쓰면 된다.

    const callActionInOtherModule = async (store, { payload }) => {
      try {
        store.dispatch("moduleB/actionName", { payload }, { root: true });
      } catch (e) {
        console.error(e);
      }
    };
    

    { root: true }를 꼭 넣어야 한다.

    Tags: JavaScript, Vue.js, Vuex

    Categories: IT

    Updated: September 22, 2020

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    Leave a comment

    You may also enjoy

    requestAnimationFrame의 callback 함수 실행 시점 - 두 번째 rAF에서야 진짜로 화면에 그려졌다고 보장할 수 있는 이유

    2 minute read

    requestAnimationFrame의 콜백 함수 실행 시점이 자꾸 햇갈려서 정리해보았다.

    Next.js가 closure를 만들어서 컴포넌트 초기값으로 상태를 저장해버린 건에 대하여(stale closure)

    9 minute read

    환경

    web game frontend 개발 POC(11키티즈)

    2 minute read

    11키티즈 개발을 위하여 frontend에서 POC를 수행하고 그 결과를 정리했다(2024년 초 수행).

    아테네 민주정의 펠라스기 기원 - 망각된 선주민 질서와 문명 기억의 역설 -

    34 minute read

    아테네 민주정의 펠라스기 기원: 망각된 선주민 질서와 문명 기억의 역설

    • Follow:
    • Twitter
    • Facebook
    • GitHub
    • Feed
    © 2025 Never test. Powered by Jekyll & Minimal Mistakes.