[Vue] actions, getters, index, mutations 란?

[Vue] actions, getters, index, mutations 란?

actions
  • 함수
  • dispatch로 actions 사용 가능
    • ex) this.$store.dispatch("scenarios/getScenariosOutput")

getters
  • 불러오는 것

index
  • 기본 파일
  • ...mapGetters( {})로 index에 있는거 가져올 수 있음
  • state로 index 사용 가능
    • ex) context.rootState.open_api~~;

mutations
  • 함수(비동기식)
  • commit mutations 사용 가능
    • context.commit("setOutputData", data_json.data);
  • context를 보려면 JSON.stringify(context)
  • Vuex 저장소에서 실제로 상태를 변경하는 유일한 방법은 mutation을 사용하는 것


댓글

이 블로그의 인기 게시물

[Python] # -*- coding: utf-8 -*-를 쓰는 이유

[소프트웨어공학] NS(Nassi-Schneiderman) 차트

[컴퓨터네트워크] Telnet이란?