From fb561e522c9b5680ed2ef62cb87bcb84eddfcd4e Mon Sep 17 00:00:00 2001 From: wanglihui <1769794040@qq.com> Date: Tue, 16 Apr 2024 23:49:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=E7=BE=8E=E5=8C=96=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/theme/Layout.vue | 72 ++++++++++++++ .vitepress/theme/components/HomePreview.vue | 102 ++++++++++---------- .vitepress/theme/index.ts | 13 ++- README.md | 1 + tsconfig.json | 23 +++++ 5 files changed, 153 insertions(+), 58 deletions(-) create mode 100644 .vitepress/theme/Layout.vue create mode 100644 tsconfig.json diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue new file mode 100644 index 0000000..71d5e16 --- /dev/null +++ b/.vitepress/theme/Layout.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/.vitepress/theme/components/HomePreview.vue b/.vitepress/theme/components/HomePreview.vue index 16efd6f..1254383 100644 --- a/.vitepress/theme/components/HomePreview.vue +++ b/.vitepress/theme/components/HomePreview.vue @@ -1,89 +1,89 @@ diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 4e87bcb..149b9ed 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -1,16 +1,15 @@ -import { h } from "vue"; import Theme from "vitepress/theme"; +import type { EnhanceAppContext } from "vitepress"; +import Layout from "./Layout.vue"; + import "./styles/var.css"; import "./styles/custom.css"; -import 'uno.css'; +import "uno.css"; import HomePreview from "./components/HomePreview.vue"; export default { ...Theme, - Layout() { - return h(Theme.Layout, null, { - "home-features-after": () => h(HomePreview), - }); - }, + Layout, + enhanceApp({ app }: EnhanceAppContext) {}, }; diff --git a/README.md b/README.md index b650d34..48ed2de 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,4 @@ pnpm run build ``` sh pnpm run serve ``` + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..78c196c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "rootDir": ".", + "module": "esnext", + "moduleResolution": "bundler", + "jsx": "preserve", + "resolveJsonModule": true, + "esModuleInterop": true, + "types": [ + "vite/client", + "vitepress" + ], + }, + "include": [ + ".vitepress/**/*.ts", + ".vitepress/**/*.vue", + "src/**/*.ts", + ], + "exclude": [ + "node_modules", + ".vitepress/dist" + ] +}