Skip to content

Commit 2baab2d

Browse files
committed
docs: 自定义docs组件
1 parent b178253 commit 2baab2d

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

packages/hooks/docs/.vitepress/theme/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { App } from 'vue'
12
import DefaultTheme from 'vitepress/theme'
23
import DemoBlock from '@vue-hooks-plus/vitepress-demo-block'
34
import VhpButton from '../components/button'
@@ -6,8 +7,7 @@ import './var.less'
67

78
export default {
89
...DefaultTheme,
9-
10-
enhanceApp({ app, router, siteData }) {
10+
enhanceApp({ app }: { app: App<Element> }) {
1111
app.component('demo', DemoBlock)
1212
app.component('vhp-button', VhpButton)
1313
},

packages/hooks/docs/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist", //输出文件
5+
"lib": ["esnext", "dom"],
6+
"baseUrl": "./",
7+
"rootDir": "./",
8+
"types": ["node", "vitest", "vitest/globals"],
9+
"paths": {
10+
"@/*": ["src/*"],
11+
"vue-hooks-plus": ["src/index.ts"]
12+
}
13+
},
14+
"include": [".vitepress/components/**/*.vue", ".vitepress/**/*.ts"]
15+
}

packages/hooks/scripts/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const buildConfig: UserConfig = {
1313
'src/*/__tests__/*.spec.*',
1414
'**/*.tests.*',
1515
'**/*.d.ts',
16+
'docs/**/*.ts',
1617
'**/*.vue',
1718
'**/__tests__',
1819
],

packages/hooks/tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"vue-hooks-plus": ["src/index.ts"]
1212
}
1313
},
14-
"include": [
15-
"src/**/*.ts",
16-
"src/**/demo/*.vue",
17-
"docs/.vitepress/components/**/*.vue",
18-
"docs/.vitepress/**/*.ts"
19-
],
14+
"include": ["src/**/*.ts", "src/**/demo/*.vue"],
2015
"exclude": ["node_modules", "dist", "lib", "es", "example", "src/**/__tests__/*"]
2116
}

0 commit comments

Comments
 (0)