feat: add site demo

This commit is contained in:
2023-02-26 08:20:18 +08:00
parent 74e359a47d
commit f732c214e3
9 changed files with 193 additions and 3 deletions

View File

@ -1,5 +1,11 @@
import { defineConfig } from 'vitepress'
import { getNav } from './config/nav'
import { getSidebar } from './config/sidebar'
export default defineConfig({
title: 'vue3组件库站点'
title: 'vue3组件库站点',
themeConfig: {
nav: getNav(),
sidebar: getSidebar()
}
})

View File

@ -0,0 +1,10 @@
import type { DefaultTheme } from 'vitepress'
export const getNav = (): DefaultTheme.NavItem[] => {
return [
{
text: '组件',
link: '/components/'
}
]
}

View File

@ -0,0 +1,10 @@
import type { DefaultTheme } from 'vitepress'
export const getSidebar = (): DefaultTheme.Sidebar => {
return [
{
text: 'Button 按钮',
link: '/components/button/'
}
]
}

View File

@ -0,0 +1,12 @@
import type { Theme } from 'vitepress'
// eslint-disable-next-line import/no-named-as-default
import DefaultTheme from 'vitepress/theme'
import { AntdTheme } from 'vite-plugin-vitepress-demo/theme'
export default {
...DefaultTheme,
enhanceApp(ctx) {
DefaultTheme.enhanceApp?.(ctx)
ctx.app.component('Demo', AntdTheme)
}
} as Theme