Vuex
... Less than 1 minute
# Vuex
Only one small change here and the entire store is setup to take advantage of the new Composition API... Just like the App and Router we now have a method for creating a store as opposed to using the new
keyword.
store.js Vue 2
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state:{},
mutations:{}
actions:{},
modules:{},
getters:{}
})
store.js Vue 3
import { createStore } from 'vuex'
export const store = createStore({
state:{},
mutations:{}
actions:{},
modules:{},
getters:{}
})