vuex學習筆記

實現功能:在info.vue傳遞一個狀態到about.vue    實現: 1. 在state.js中,     state:{}中是狀態的管理,先定義count計數值爲0,     mutations:{}中是修改狀態的方法,每次狀態修改,count加1。  2. 在info.vue中,觸發狀態改變:store.commit('increase');     每次點擊按鈕,狀態管理中的count
相關文章
相關標籤/搜索