mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-24 04:06:48 +08:00
- 创建 NotFound.vue 组件实现404页面功能 - 在主题配置中注册并集成自定义404页面 - 实现中英文双语支持和自动重定向功能 - 添加倒计时自动跳转到首页的功能 - 设计美观的404错误页面样式和布局 - 提供相关文档页面链接建议和返回首页按钮
20 lines
510 B
TypeScript
20 lines
510 B
TypeScript
// https://vitepress.dev/guide/custom-theme
|
|
import { h } from 'vue'
|
|
import type { Theme } from 'vitepress'
|
|
import DefaultTheme from 'vitepress/theme'
|
|
import './style.css'
|
|
import NotFound from './NotFound.vue'
|
|
|
|
export default {
|
|
extends: DefaultTheme,
|
|
Layout: () => {
|
|
return h(DefaultTheme.Layout, null, {
|
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
|
"not-found": () => h(NotFound)
|
|
})
|
|
},
|
|
enhanceApp({ app, router, siteData }) {
|
|
// ...
|
|
}
|
|
} satisfies Theme
|