|
28 | 28 | </v-app> |
29 | 29 | </template> |
30 | 30 |
|
31 | | -<script setup> |
32 | | -import { computed, provide, ref } from 'vue'; |
| 31 | +<script setup lang="ts"> |
33 | 32 | import { useDisplay } from 'vuetify'; |
34 | 33 | import AppBar from './documentation/layout/AppBar.vue'; |
35 | 34 | import MenuComponent from './documentation/components/MenuComponent.vue'; |
36 | 35 | import DocsPage from './documentation/DocsPage.vue'; |
37 | 36 | import { useCoreStore } from './stores/index'; |
38 | | -// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars |
39 | 37 | import Prism from 'prismjs'; |
40 | 38 | import 'prismjs/components/prism-typescript.js'; |
41 | 39 |
|
42 | 40 |
|
43 | | -const { smAndUp } = useDisplay(); |
| 41 | +onMounted(() => { |
| 42 | + Prism.highlightAll(); |
| 43 | +}); |
| 44 | +
|
44 | 45 |
|
45 | | -const isSmAndUp = computed(() => smAndUp.value); |
| 46 | +const { smAndUp } = useDisplay(); |
| 47 | +const isSmAndUp = computed<boolean>(() => smAndUp.value); |
46 | 48 | const store = useCoreStore(); |
47 | | -const drawer = ref(isSmAndUp.value); |
48 | | -const drawerOptions = ref({ |
| 49 | +const drawer = ref<boolean>(isSmAndUp.value); |
| 50 | +const drawerOptions: Ref<Docs.DrawerOptions> = ref<Docs.DrawerOptions>({ |
49 | 51 | absolute: false, |
50 | 52 | color: '', |
51 | 53 | elevation: 10, |
52 | 54 | }); |
53 | 55 |
|
| 56 | +const codeBlockPlugin: string = 'prismjs'; |
| 57 | +const codeBlockLightTheme: string = 'tomorrow'; |
| 58 | +const codeBlockDarkTheme: string = 'tomorrow'; |
54 | 59 |
|
55 | | -const codeBlockPlugin = 'prismjs'; |
56 | | -const codeBlockLightTheme = 'tomorrow'; |
57 | | -const codeBlockDarkTheme = 'tomorrow'; |
58 | | -
|
59 | | -const codeBlockSettings = ref({ |
| 60 | +const codeBlockSettings: Ref<Docs.CodeBlockSettings> = ref<Docs.CodeBlockSettings>({ |
60 | 61 | plugin: codeBlockPlugin, |
61 | 62 | theme: codeBlockDarkTheme, |
62 | 63 | }); |
63 | 64 |
|
64 | | -function updateCodeBlockTheme(val) { |
| 65 | +function updateCodeBlockTheme(val: string): void { |
65 | 66 | codeBlockSettings.value.theme = codeBlockLightTheme; |
66 | 67 |
|
67 | 68 | if (val === 'dark') { |
68 | 69 | codeBlockSettings.value.theme = codeBlockDarkTheme; |
69 | 70 | } |
70 | 71 | } |
71 | 72 |
|
72 | | -provide('drawerOptions', drawerOptions); |
73 | | -provide('links', store.links); |
| 73 | +provide<Docs.CodeBlockSettings>('codeBlockSettings', codeBlockSettings.value); |
| 74 | +provide<Docs.DrawerOptions>('drawerOptions', drawerOptions.value); |
| 75 | +provide<Docs.Links>('links', store.links); |
74 | 76 |
|
75 | | -function toggleDrawer() { |
| 77 | +function toggleDrawer(): void { |
76 | 78 | drawer.value = !drawer.value; |
77 | 79 | } |
78 | 80 | </script> |
79 | 81 |
|
80 | | -<style lang="scss" scoped> |
81 | | -:deep(code) { |
82 | | - &.ic { |
83 | | - background-color: rgb(255 255 255 / 10%) !important; |
84 | | - border-radius: 3px; |
85 | | - font-size: 85%; |
86 | | - font-weight: normal; |
87 | | - padding: 0.2em 0.4em; |
88 | | - } |
89 | | -} |
90 | | -</style> |
91 | | - |
92 | 82 | <style lang="scss"> |
93 | 83 | html { |
94 | 84 | scroll-behavior: smooth; |
|
0 commit comments