File tree Expand file tree Collapse file tree 3 files changed +8
-31
lines changed
apps/vitepress-demo/.vitepress Expand file tree Collapse file tree 3 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ import path from 'node:path'
22import { defineConfig } from 'vitepress'
33import { getThemeConfig , getVipFooter , zhSearch } from '@142vip/vitepress'
44import { OPEN_SOURCE_ADDRESS , getDocSiteBase } from '@142vip/utils'
5- import type { DefaultTheme } from 'vitepress/types/default-theme '
5+ import type { NavbarConfig , SidebarConfig } from '@142vip/vitepress '
66import { name as pkgName , version as pkgVersion } from '../package.json'
77
88/**
99 * 导航栏
1010 */
11- const navbarConfig : DefaultTheme . NavItem [ ] = [
11+ const navbarConfig : NavbarConfig = [
1212 { text : '🔥 首页' , link : '/docs/index.md' } ,
1313 {
1414 text : '💻 示例文档' ,
@@ -37,7 +37,7 @@ const navbarConfig: DefaultTheme.NavItem[] = [
3737/**
3838 * 侧边栏
3939 */
40- const sidebarConfig : DefaultTheme . SidebarItem [ ] = [
40+ const sidebarConfig : SidebarConfig = [
4141 {
4242 text : '示例文档' ,
4343 collapsed : false ,
Original file line number Diff line number Diff line change 11<script lang="ts" setup>
2- import { defineComponent , onMounted , ref } from ' vue'
2+ import { onMounted , ref } from ' vue'
33import {
44 VipBackTop ,
55 VipContactAuthor ,
66 VipProjectTable ,
77 VipTeam ,
88} from ' @142vip/vitepress/components'
99import { useData } from ' vitepress'
10- import { ElImage } from ' element-plus'
1110
1211const { isDark } = useData ()
1312const tableData = ref <any []>([])
1413
15- defineComponent ({
16- components: {
17- ElImage ,
18- },
19- })
20-
2114/**
2215 * 异步加载表格数据
2316 */
@@ -83,14 +76,14 @@ onMounted(async () => {
8376 <h2 >趋势</h2 >
8477 <!-- 支持黑色主题 -->
8578 <div class =" star-history" >
86- <ElImage
79+ <img
8780 :src =" `https://api.star-history.com/svg?repos=142vip/core-x,142vip/408CSFamily,142vip/JavaScriptCollection&type=Date${
8881 isDark ? '&theme=dark' : ''
8982 }`"
9083 alt =" Github Star History"
9184 class =" img-border"
9285 title =" Github Star History"
93- / >
86+ >
9487 </div >
9588 </section >
9689
Original file line number Diff line number Diff line change 1- import { h } from 'vue'
2- import DefaultTheme from 'vitepress/theme'
1+ import defineVipExtendsTheme from '@142vip/vitepress/theme'
32import './style.css'
4- import type { Theme } from 'vitepress'
5- import { VipBackTop } from '@142vip/vitepress/components'
6- // 导入 element-plus样式
7- // import 'element-plus/dist/index.css'
83
94/**
105 * 自定义主题
116 * 参考: https://vitepress.dev/guide/custom-theme
127 */
13- export default {
14- extends : DefaultTheme ,
15- Layout : ( ) => {
16- return h ( DefaultTheme . Layout , null , {
17- // https://vitepress.dev/guide/extending-default-theme#layout-slots
18- 'doc-bottom' : ( ) => h ( VipBackTop ) ,
19- } )
20- } ,
21- // todo 查看这里的app、router、siteData的作用
22- enhanceApp ( ) {
23- } ,
24- } satisfies Theme
8+ export default defineVipExtendsTheme ( )
You can’t perform that action at this time.
0 commit comments