mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +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'
|
export const mutations = {
|
||||||
|
increment(state) {
|
||||||
const createStore = () => {
|
state.counter++
|
||||||
return new Vuex.Store({
|
}
|
||||||
state: {
|
|
||||||
counter: 0
|
|
||||||
},
|
|
||||||
mutations
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default createStore
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
const mutations = {
|
|
||||||
increment(state) {
|
|
||||||
state.counter++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default mutations
|
|
Loading…
Reference in New Issue
Block a user