chore: change

This commit is contained in:
2023-03-28 08:25:18 +08:00
parent 163e29dfd1
commit f394f48853
9 changed files with 184 additions and 205 deletions

View File

@ -1,11 +1,33 @@
import { fileURLToPath } from 'url'
import { resolve } from 'path'
import { defineConfig } from 'vitepress'
import vueJsxPlugin from '@vitejs/plugin-vue-jsx'
import { VitePluginVitepressDemo } from 'vite-plugin-vitepress-demo'
import { getNav } from './config/nav'
import { getSidebar } from './config/sidebar'
import { getRewrites } from './config/rewrites'
const baseSrc = fileURLToPath(new URL('./', import.meta.url))
export default defineConfig({
title: 'vue3组件库站点',
rewrites: getRewrites(),
srcExclude: ['**/node_modules/**', '**/demos/**', '**/tests/**', '**/README.md'],
mpa: true,
themeConfig: {
nav: getNav(),
sidebar: getSidebar()
},
vite: {
plugins: [
vueJsxPlugin(),
VitePluginVitepressDemo({
glob: ['**/demos/**/*.vue']
})
],
resolve: {
alias: {
'antd-tiny-vue': resolve(baseSrc, '../../components')
}
}
}
})

View File

@ -0,0 +1,5 @@
export const getRewrites = (): Record<string, string> => {
return {
// '/site/index.md': '/index.md'
}
}

View File

@ -2,7 +2,8 @@ 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'
import Antd from '../../../components'
// @ts-expect-error this is a local module
import Antd from 'antd-tiny-vue'
export default {
...DefaultTheme,

View File

@ -1,9 +0,0 @@
# Button 按钮
按钮用于开始一个即时操作。
## 演示例子
<demo src="../../demos/button/basic.vue"></demo>

View File

@ -1,3 +0,0 @@
# 组件列表
* [button](./button/)

View File

@ -1,25 +0,0 @@
<docs>
---
title: 基础按钮
---
这是一个Button的基础按钮
</docs>
<script lang="ts" setup></script>
<template>
<div style="display: flex; gap: 10px; padding-bottom: 10px">
<a-button>这是按钮</a-button>
<a-button type="primary">这是按钮</a-button>
<a-button
type="primary"
danger
>
这是按钮
</a-button>
</div>
</template>
<style scoped></style>

View File

@ -1,12 +0,0 @@
import { defineConfig } from 'vite'
import vueJsxPlugin from '@vitejs/plugin-vue-jsx'
import { VitePluginVitepressDemo } from 'vite-plugin-vitepress-demo'
export default defineConfig({
plugins: [
vueJsxPlugin(),
VitePluginVitepressDemo({
glob: ['**/demos/**/*.vue']
})
]
})