27 lines
485 B
TypeScript
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
|
|
}
|
|
}
|