Init
This commit is contained in:
44
.vitepress/theme/store/index.ts
Normal file
44
.vitepress/theme/store/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { reactive } from 'vue'
|
||||
import { PostData } from '../utils/posts.data'
|
||||
|
||||
interface StoreState {
|
||||
selectedPosts: PostData[]
|
||||
currTag: string
|
||||
currPost: PostData
|
||||
currPage: number
|
||||
searchDialog: boolean
|
||||
splashLoading: boolean
|
||||
fireworksEnabled: boolean
|
||||
SpinePlayerEnabled: boolean
|
||||
showDropdownMenu: boolean
|
||||
darkMode: 'light' | 'dark' | 'system'
|
||||
}
|
||||
|
||||
const state: StoreState = reactive({
|
||||
selectedPosts: [],
|
||||
currTag: '',
|
||||
currPost: {
|
||||
id: 0,
|
||||
title: '',
|
||||
content: '',
|
||||
href: '',
|
||||
create: 0,
|
||||
update: 0,
|
||||
tags: [],
|
||||
wordCount: 0,
|
||||
cover: '',
|
||||
excerpt: '',
|
||||
pinned: false
|
||||
},
|
||||
currPage: 1,
|
||||
searchDialog: false,
|
||||
splashLoading: true,
|
||||
fireworksEnabled: true,
|
||||
SpinePlayerEnabled: true,
|
||||
showDropdownMenu: false,
|
||||
darkMode: 'system',
|
||||
})
|
||||
|
||||
export function useStore() {
|
||||
return { state }
|
||||
}
|
||||
Reference in New Issue
Block a user