Skip to content

Commit 475ddd7

Browse files
Updating docs
1 parent 3818de9 commit 475ddd7

File tree

1 file changed

+35
-149
lines changed

1 file changed

+35
-149
lines changed

src/App.vue

Lines changed: 35 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<v-app id="home">
33
<!-- ====================================================== App Bar -->
4-
<AppBar @updated-drawer="toggleDrawer" />
4+
<AppBar
5+
@changed-theme="updateCodeBlockTheme"
6+
@updated-drawer="toggleDrawer"
7+
/>
58

69
<!-- ====================================================== Navigation Drawer -->
710
<v-navigation-drawer
@@ -14,174 +17,57 @@
1417
</v-navigation-drawer>
1518

1619
<!-- ====================================================== Main Container -->
17-
<v-main class="main-container pb-10">
18-
<v-responsive>
19-
<v-container class="px-10">
20-
<DocsPage />
21-
</v-container>
22-
</v-responsive>
20+
<v-main class="pb-10">
21+
<v-container class="px-7">
22+
<DocsPage :codeBlockOptions="codeBlockSettings" />
23+
</v-container>
2324
</v-main>
2425
</v-app>
2526
</template>
2627

2728
<script setup>
2829
import { provide, ref } from 'vue';
30+
import { useDisplay } from 'vuetify';
2931
import AppBar from './documentation/layout/AppBar.vue';
3032
import MenuComponent from './documentation/components/MenuComponent.vue';
3133
import DocsPage from './documentation/DocsPage.vue';
3234
import { useCoreStore } from './stores/index';
35+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
36+
import Prism from 'prismjs';
37+
import 'prismjs/components/prism-typescript.js';
3338
34-
const store = useCoreStore();
3539
36-
const drawer = ref(true);
40+
const { smAndUp } = useDisplay();
41+
42+
const isSmAndUp = computed(() => smAndUp.value);
43+
const store = useCoreStore();
44+
const drawer = ref(isSmAndUp.value);
3745
const drawerOptions = ref({
3846
absolute: false,
3947
color: '',
4048
elevation: 10,
4149
});
42-
const links = store.links;
43-
44-
const menuItems = reactive([
45-
{
46-
href: '#home',
47-
icon: 'mdi:mdi-home',
48-
title: 'Home',
49-
},
50-
{
51-
href: '#installation',
52-
icon: 'mdi:mdi-plus-thick',
53-
title: 'Installation',
54-
},
55-
{
56-
href: '#description',
57-
icon: 'mdi:mdi-information-outline',
58-
title: 'Description',
59-
},
60-
{
61-
href: '#props',
62-
icon: 'mdi:mdi-cog',
63-
items: [
64-
{
65-
href: '#props',
66-
icon: 'mdi:mdi-checkbox-outline',
67-
key: 'shared-props',
68-
title: 'Props',
69-
},
70-
{
71-
href: '#props-shared',
72-
icon: 'mdi:mdi-checkbox-outline',
73-
key: 'shared-props',
74-
title: 'Shared Props',
75-
},
76-
],
77-
title: 'Props',
78-
},
79-
{
80-
href: '#components',
81-
icon: 'mdi:mdi-cog',
82-
items: [
83-
{
84-
icon: 'mdi:mdi-github',
85-
key: 'vuetify-github',
86-
link: links.vuetifyGithub,
87-
title: 'Github',
88-
},
89-
{
90-
key: 'vuetify',
91-
link: `${links.vuetify}en/components/all/`,
92-
title: 'Components',
93-
},
94-
{
95-
href: '#components-props',
96-
icon: 'mdi:mdi-checkbox-outline',
97-
key: 'shared-props',
98-
title: 'Props',
99-
},
100-
{
101-
href: '#components-shared-props',
102-
icon: 'mdi:mdi-checkbox-outline',
103-
key: 'shared-props',
104-
title: 'Shared Props',
105-
},
106-
{
107-
href: '#components-v-inline-checkbox',
108-
icon: 'mdi:mdi-checkbox-outline',
109-
key: 'v-checkbox',
110-
link: `${links.vuetify}en/api/v-checkbox/`,
111-
title: 'VCheckbox',
112-
},
113-
{
114-
href: '#components-v-inline-select',
115-
icon: 'mdi:mdi-format-list-bulleted',
116-
key: 'v-select',
117-
link: `${links.vuetify}en/api/v-select/`,
118-
title: 'VSelect',
119-
},
120-
{
121-
href: '#components-v-inline-switch',
122-
icon: 'mdi:mdi-toggle-switch-off-outline',
123-
key: 'v-switch',
124-
link: `${links.vuetify}en/api/v-switch/`,
125-
title: 'VSwitch',
126-
},
127-
{
128-
href: '#components-v-inline-textarea',
129-
icon: 'mdi:mdi-text-long',
130-
key: 'v-textarea',
131-
link: `${links.vuetify}en/api/v-textarea/`,
132-
title: 'VTextarea',
133-
},
134-
{
135-
href: '#components-v-inline-textfield',
136-
icon: 'mdi:mdi-minus',
137-
key: 'v-text-field',
138-
link: `${links.vuetify}en/api/v-text-field/`,
139-
title: 'VTextField',
140-
},
141-
],
142-
key: 'components',
143-
title: 'Components',
144-
},
145-
{
146-
href: '#events',
147-
icon: 'mdi:mdi-calendar-star',
148-
title: 'Events',
149-
},
150-
{
151-
href: '#slots',
152-
icon: 'mdi:mdi-slot-machine',
153-
title: 'Slots',
154-
},
155-
{
156-
href: '#sass-variables',
157-
icon: 'mdi:mdi-sass',
158-
title: 'SASS Variables',
159-
},
160-
{
161-
href: '#example',
162-
icon: 'mdi:mdi-code-json',
163-
title: 'Example',
164-
},
165-
{
166-
href: '#dependencies',
167-
icon: 'mdi:mdi-asterisk-circle-outline',
168-
title: 'Dependencies',
169-
},
170-
{
171-
href: '#license',
172-
icon: 'mdi:mdi-card-account-details-outline',
173-
title: 'License',
174-
},
175-
{
176-
href: '#legal',
177-
icon: 'mdi:mdi-scale-balance',
178-
title: 'Legal',
179-
},
180-
]);
50+
51+
52+
const codeBlockPlugin = 'prismjs';
53+
const codeBlockLightTheme = 'tomorrow';
54+
const codeBlockDarkTheme = 'tomorrow';
55+
56+
const codeBlockSettings = ref({
57+
plugin: codeBlockPlugin,
58+
theme: codeBlockDarkTheme,
59+
});
60+
61+
function updateCodeBlockTheme(val) {
62+
codeBlockSettings.value.theme = codeBlockLightTheme;
63+
64+
if (val === 'dark') {
65+
codeBlockSettings.value.theme = codeBlockDarkTheme;
66+
}
67+
}
18168
18269
provide('drawerOptions', drawerOptions);
18370
provide('links', store.links);
184-
provide('menuItems', menuItems);
18571
18672
function toggleDrawer() {
18773
drawer.value = !drawer.value;

0 commit comments

Comments
 (0)