mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
example(vuex-store): change to module store (#4923)
This commit is contained in:
parent
f70645e5aa
commit
be41ae1c2f
@ -1,14 +1,9 @@
|
||||
import Vuex from 'vuex'
|
||||
export const state = () => ({
|
||||
counter: 0
|
||||
})
|
||||
|
||||
import mutations from './mutations'
|
||||
|
||||
const createStore = () => {
|
||||
return new Vuex.Store({
|
||||
state: {
|
||||
counter: 0
|
||||
},
|
||||
mutations
|
||||
})
|
||||
export const mutations = {
|
||||
increment(state) {
|
||||
state.counter++
|
||||
}
|
||||
}
|
||||
|
||||
export default createStore
|
||||
|
@ -1,7 +0,0 @@
|
||||
const mutations = {
|
||||
increment(state) {
|
||||
state.counter++
|
||||
}
|
||||
}
|
||||
|
||||
export default mutations
|
Loading…
Reference in New Issue
Block a user