mirror of
				https://github.com/antd-tiny-vue/antd-tiny-vue.git
				synced 2025-10-31 08:41:45 +08:00 
			
		
		
		
	chore: change
This commit is contained in:
		| @@ -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') | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| }) | ||||
|   | ||||
							
								
								
									
										5
									
								
								site/.vitepress/config/rewrites.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								site/.vitepress/config/rewrites.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| export const getRewrites = (): Record<string, string> => { | ||||
|   return { | ||||
|     // '/site/index.md': '/index.md' | ||||
|   } | ||||
| } | ||||
| @@ -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, | ||||
|   | ||||
| @@ -1,9 +0,0 @@ | ||||
| # Button 按钮 | ||||
|  | ||||
| 按钮用于开始一个即时操作。 | ||||
|  | ||||
|  | ||||
| ## 演示例子 | ||||
|  | ||||
|  | ||||
| <demo src="../../demos/button/basic.vue"></demo> | ||||
| @@ -1,3 +0,0 @@ | ||||
| # 组件列表 | ||||
|  | ||||
| * [button](./button/) | ||||
| @@ -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> | ||||
| @@ -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'] | ||||
|     }) | ||||
|   ] | ||||
| }) | ||||
		Reference in New Issue
	
	Block a user