File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <img :src =" image" alt =" " class =" preview" >
3
+ </template >
4
+
5
+ <script setup lang="ts">
6
+ import { computed } from ' vue'
7
+ import { useData , withBase } from ' vitepress'
8
+
9
+ const props = defineProps <{ name: string }>()
10
+
11
+ const { isDark } = useData ()
12
+ const image = computed (() => withBase (` /services/${props .name }${isDark .value ? ' -dark' : ' ' }.png ` ))
13
+ </script >
14
+
15
+ <style scoped>
16
+ .preview {
17
+ border : 1px solid var (--vp-c-divider );
18
+ border-radius : 8px ;
19
+ margin : 16px 0 ;
20
+ }
21
+ </style >
Original file line number Diff line number Diff line change
1
+ import type { Theme } from 'vitepress'
1
2
import DefaultTheme from 'vitepress/theme'
2
3
import './custom.css'
4
+ import PreviewService from '../components/preview-service.vue'
3
5
4
- export default DefaultTheme
6
+ export default {
7
+ extends : DefaultTheme ,
8
+ enhanceApp ( { app } ) {
9
+ app . component ( 'PreviewService' , PreviewService )
10
+ } ,
11
+ } satisfies Theme
You can’t perform that action at this time.
0 commit comments