1234567891011121314151617181920212223242526 |
- const state = {
- main: 0
- }
- const mutations = {
- DECREMENT_MAIN_COUNTER (state) {
- state.main--
- },
- INCREMENT_MAIN_COUNTER (state) {
- state.main++
- }
- }
- const actions = {
- someAsyncTask ({ commit }) {
- // do something async
- commit('INCREMENT_MAIN_COUNTER')
- }
- }
- export default {
- state,
- mutations,
- actions
- }
|