Files
zhdiary/packages/web/store/global.ts
T
2019-12-25 00:11:26 +07:00

27 lines
485 B
TypeScript

import { Module, VuexModule, Mutation } from 'vuex-module-decorators'
import { DataType } from '../utils/build-api'
@Module({
name: 'global',
stateFactory: true,
namespaced: true,
})
export default class GlobalModule extends VuexModule {
hash: Record<DataType, Record<string, string>> = {
posts: {},
slides: {},
}
tag: Record<string, number> = {}
@Mutation
setHash (h: any) {
this.hash = h
}
@Mutation
setTag (tag: any) {
this.tag = tag
}
}