Initial commit
This commit is contained in:
21
docs/.vitepress/theme/index.ts
Normal file
21
docs/.vitepress/theme/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import Layout from './Layout.vue'
|
||||
import type { Theme } from 'vitepress'
|
||||
import { createPinia } from 'pinia'
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
import { useSettingsStore } from './stores/settings'
|
||||
import './style.css'
|
||||
|
||||
export default {
|
||||
Layout,
|
||||
enhanceApp({ app }) {
|
||||
const pinia = createPinia()
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
app.use(pinia)
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
const settingsStore = useSettingsStore(pinia)
|
||||
settingsStore.initTheme()
|
||||
settingsStore.fetchVideoList()
|
||||
}
|
||||
}
|
||||
} satisfies Theme
|
||||
Reference in New Issue
Block a user