Skip to content
Snippets Groups Projects
shows.js 371 B
Newer Older
  • Learn to ignore specific revisions
  • const state = {
      items: [],
    }
    
    const getters = {
      items: state => state.items,
      itemCount: state => state.items.length,
    }
    
    const actions = {
      addItem ({commit}, item) {
        commit('addItem', item)
      }
    }
    
    const mutations = {
      addItem (state, item) {
        state.items.push(item)
      }
    }
    
    export default {
      namespaced: true,
      state,
      getters,
      actions,
      mutations,
    }