마

Vuex Tutorial #7 - Actions

· 2019-02-14 (목) 06:41:29 · 1124

Actions  https://vuex.vuejs.org/kr/guide/actions.html

 

비동기 지원..

 

this.$store.dispatch('reducePrice', amount)

 

context.commit안에 reducePrice는 mutations안의 reducePrice를 부름

actions: {

  reducePrice: (context, payload) => {

    setTimeout(function(){

      context.commit('reducePrice', payload)

    }, 2000)

    }

}

 

https://github.com/iamshaunjp/vuex-playlist/tree/lesson-07

 

|
댓글을 작성하시려면 로그인이 필요합니다.

JS프레임워크

269건
+
분류 제목 글쓴이 날짜 조회
Vue 19-02-14 조회 1,125
Vue 19-02-13 조회 1,028
Vue 19-02-13 조회 1,167
Vue 19-02-13 조회 1,082
Vue 19-02-12 조회 1,055
Vue 19-02-12 조회 1,221
Vue 19-02-12 조회 1,290
Vue 19-02-11 조회 1,081
Vue 19-02-11 조회 1,129
Vue 19-02-11 조회 1,076
Vue 19-02-10 조회 1,164
Vue 19-02-10 조회 1,148
Vue 19-02-10 조회 1,343
Vue 19-02-09 조회 1,083
Vue 19-02-09 조회 1,326
Vue 19-02-09 조회 1,054
Vue 19-02-08 조회 1,233
Vue 19-02-08 조회 1,077
Vue 19-02-08 조회 1,452
Vue 19-02-07 조회 1,091
Vue 19-02-07 조회 1,220
Vue 19-02-07 조회 1,203
Vue 19-02-06 조회 1,209
Vue 19-02-06 조회 1,086
Vue 19-02-06 조회 1,189
Vue 19-02-05 조회 1,091
Vue 19-02-05 조회 1,158
Vue 19-02-05 조회 1,032
Vue 19-02-04 조회 1,357
Vue 19-02-04 조회 1,489