반응형
Nuxt.js Vuex / console.login 변환으로 미래 상태를 확인할 수 있습니까?
앱을 빌드하기 위해 Nuxt.js와 모듈 Vuex를 사용하고 있는데 질문이 있습니다.
test() 함수를 트리거할 수 있는 버튼이 있습니다.
페이지/패킷을 클릭합니다.표시하다
<button @click="test">Test</button>
methods: {
test() {
this.$store.commit('user/test', { value: 'after' })
}
}
스토어/사용자.삭제
export const state = () => ({
hello: 'before'
})
export const mutations = {
test(state, { value }) {
console.log(state) // <- when I trying to console.log here, the value of hello was 'after'
state.hello = value
}
}
제가 뭘 놓쳤나요? 아니면 그게 정상인가요?
언급URL : https://stackoverflow.com/questions/61894313/nuxt-js-vuex-the-console-log-in-mutation-can-see-the-future-state
반응형
'programing' 카테고리의 다른 글
하위의 매개 변수가 있는 Vue 트리거링 함수가 예기치 않음 (0) | 2022.07.28 |
---|---|
Vue - 렌더링 완료에 연결할 수 있는 방법이 있습니까? (0) | 2022.07.28 |
JMS/메시지 큐를 실제로 사용합니까? (0) | 2022.07.28 |
Vue 프로그레시브 웹 애플리케이션 처리 방법 (0) | 2022.07.28 |
봄 - @Transactional - 배경에서 무슨 일이 일어나나요? (0) | 2022.07.28 |