vuex tutorial medium code example
Example 1: vuex tutorial
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment (state) {
state.count++
}
}
})
Example 2: vuex store example medium
import Vuex from ‘vuex’import Vue from ‘vue’Vue.use(Vuex)export default new Vuex.Store({state: {},getters:{},mutations: {},actions:{}})