'首次提交'
This commit is contained in:
25
src/store/index.ts
Normal file
25
src/store/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {InjectionKey} from 'vue'
|
||||
import {createStore, Store} from 'vuex'
|
||||
|
||||
export interface State {
|
||||
count: number
|
||||
}
|
||||
|
||||
export const key: InjectionKey<Store<State>> = Symbol()
|
||||
|
||||
export const store = createStore<State>({
|
||||
state() {
|
||||
return {
|
||||
count: 0
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
increment(state: { count: number }) {
|
||||
state.count++
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user