mirror of
https://github.com/fmhy/edit.git
synced 2026-02-19 01:31:41 +11:00
30 lines
981 B
TypeScript
30 lines
981 B
TypeScript
// Import the necessary modules and components
|
|
import { type Theme } from 'vitepress'
|
|
import DefaultTheme from 'vitepress/theme'
|
|
import Layout from './Layout.vue'
|
|
import Post from './PostLayout.vue'
|
|
import { loadProgress } from './composables/nprogress'
|
|
import './style.css'
|
|
import 'uno.css'
|
|
|
|
// Define the custom VitePress theme
|
|
export default {
|
|
extends: DefaultTheme,
|
|
Layout,
|
|
Post,
|
|
// Add a setup function to configure the theme
|
|
setup() {
|
|
// Call the enhanceApp function to add the custom post layout component and load the progress bar
|
|
this.enhanceApp({
|
|
router: this.router,
|
|
app: this.app,
|
|
// Define the mount function to be called after the VitePress app is mounted
|
|
mount(app) {
|
|
// Add the custom post layout component to the VitePress app
|
|
app.component('Post', Post)
|
|
// Call the loadProgress function with the router object as an argument
|
|
loadProgress(this.router)
|
|
}
|
|
})
|
|
}
|
|
} satisfies Theme
|