File tree 1 file changed +13
-9
lines changed
template/.vitepress/theme
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
1
// https://vitepress.dev/guide/custom-theme
2
- < % if ( ! defaultTheme ) { % > import Layout from './Layout.vue'
2
+ < % if ( ! defaultTheme ) { % > import Layout from './Layout.vue' < % if ( useTs ) { % >
3
+ import type { Theme } from 'vitepress' < % } % >
3
4
import './style.css'
4
5
5
- export default {
6
+ < % if ( ! useTs ) { % > /** @type {import('vitepress').Theme } */
7
+ < % } % > export default {
6
8
Layout ,
7
9
enhanceApp ( { app, router, siteData } ) {
8
10
// ...
9
11
}
10
- }
11
- < % } else { % > import { h } from 'vue'
12
- import Theme from 'vitepress/theme'
12
+ } < % if ( useTs ) { % > satisfies Theme< % } % >
13
+ < % } else { % > import { h } from 'vue'< % if ( useTs ) { % >
14
+ import type { Theme } from 'vitepress'< % } % >
15
+ import DefaultTheme from 'vitepress/theme'
13
16
import './style.css'
14
17
15
- export default {
16
- extends : Theme ,
18
+ < % if ( ! useTs ) { % > /** @type { import ( 'vitepress' ) . Theme } */
19
+ < % } % > export default {
20
+ extends : DefaultTheme ,
17
21
Layout : ( ) => {
18
- return h ( Theme . Layout , null , {
22
+ return h ( DefaultTheme . Layout , null , {
19
23
// https://vitepress.dev/guide/extending-default-theme#layout-slots
20
24
} )
21
25
} ,
22
26
enhanceApp ( { app, router, siteData } ) {
23
27
// ...
24
28
}
25
- } < % } % >
29
+ } < % if ( useTs ) { % > satisfies Theme < % } % > < % } % >
You can’t perform that action at this time.
0 commit comments