4
4
<v-app-bar
5
5
app
6
6
class =" top-app-bar"
7
+ clipped-left
8
+ clipped-right
7
9
color =" primary"
8
10
dark
9
11
dense
10
12
fixed
11
- clipped-left
12
- clipped-right
13
13
>
14
14
<v-app-bar-nav-icon
15
15
class =" nav-drawer-btn mr-2"
24
24
25
25
<v-spacer ></v-spacer >
26
26
27
- <v-btn :href =" links.repo" class =" mr-2" icon small target =" _blank" >
27
+ <v-btn
28
+ class =" mr-2"
29
+ :href =" links.repo"
30
+ icon
31
+ small
32
+ target =" _blank"
33
+ >
28
34
<v-icon >mdi-github</v-icon >
29
35
</v-btn >
30
36
31
- <v-btn :href =" links.npm" class =" mr-2" icon small target =" _blank" >
37
+ <v-btn
38
+ class =" mr-2"
39
+ :href =" links.npm"
40
+ icon
41
+ small
42
+ target =" _blank"
43
+ >
32
44
<v-icon >mdi-npm</v-icon >
33
45
</v-btn >
34
46
35
- <v-btn class =" mr-1" icon small @click =" toggleDark" >
47
+ <v-btn
48
+ class =" mr-1"
49
+ icon
50
+ small
51
+ @click =" toggleDark"
52
+ >
36
53
<v-icon v-if =" !dark" >mdi-weather-sunny</v-icon >
37
54
<v-icon v-else >mdi-weather-night</v-icon >
38
55
</v-btn >
39
56
</v-app-bar >
40
57
41
58
<!-- ====================================================== Navigation Drawer -->
42
59
<v-navigation-drawer
43
- app
44
60
v-model =" drawer"
61
+ app
45
62
clipped
46
- fixed
47
- :right =" !drawerOptions.right"
48
63
:color =" drawerOptions.color"
64
+ :expand-on-hover =" drawerOptions.expandOnHover"
65
+ fixed
49
66
:mini-variant =" drawerOptions.miniVariant"
50
67
:mini-variant-width =" drawerOptions.miniVariantWidth"
51
- :expand-on-hover =" drawerOptions.expandOnHover"
52
- :touchless =" drawerOptions.touchless"
68
+ :right =" !drawerOptions.right"
53
69
:stateless =" drawerOptions.stateless"
70
+ :touchless =" drawerOptions.touchless"
54
71
:width =" drawerOptions.width"
55
72
>
56
73
<v-list-item >
67
84
<Menu :drawerOptions =" drawerOptions" />
68
85
</v-navigation-drawer >
69
86
70
- <v-resize-drawer
87
+ <VResizeDrawer
71
88
v-model =" drawer"
72
89
app
73
90
clipped
74
- fixed
75
91
:color =" drawerOptions.color"
76
92
:dark =" drawerOptions.dark"
77
93
:expand-on-hover =" drawerOptions.expandOnHover"
94
+ fixed
95
+ :handle-color =" drawerOptions.handleColor"
78
96
:handle-position =" drawerOptions.handlePosition"
79
97
:light =" drawerOptions.light"
80
- :mini-variant-width =" drawerOptions.miniVariantWidth"
98
+ max-width =" 50%"
99
+ min-width =" 256"
81
100
:mini-variant =" drawerOptions.miniVariant"
101
+ :mini-variant-width =" drawerOptions.miniVariantWidth"
82
102
:overflow =" drawerOptions.overflow"
83
103
:resizable =" drawerOptions.resizable"
84
104
:right =" drawerOptions.right"
123
143
>
124
144
<v-card-title >Overflow Content</v-card-title >
125
145
</v-card >
126
- </v-resize-drawer >
146
+ </VResizeDrawer >
127
147
128
148
<!-- ====================================================== Main Container -->
129
149
<v-main
134
154
]"
135
155
:style =" mainStyles"
136
156
>
137
- <Documentation :drawerOptions =" drawerOptions" :links =" links" />
157
+ <Documentation
158
+ :drawerOptions =" drawerOptions"
159
+ :links =" links"
160
+ />
138
161
</v-main >
139
162
</v-app >
140
163
</template >
@@ -144,7 +167,6 @@ import Vue from 'vue';
144
167
import UnicornLog from ' vue-unicorn-log' ;
145
168
import Documentation from ' ./components/Documentation.vue' ;
146
169
import Menu from ' ./components/Menu.vue' ;
147
- import VResizeDrawer from ' ./components/VResizeDrawer.vue' ;
148
170
149
171
Vue .use (UnicornLog, { disabled: true });
150
172
@@ -163,7 +185,6 @@ export default {
163
185
components: {
164
186
Documentation,
165
187
Menu,
166
- VResizeDrawer,
167
188
},
168
189
computed: {
169
190
mainStyles () {
@@ -180,53 +201,50 @@ export default {
180
201
data : () => ({
181
202
dark: false ,
182
203
drawer: true ,
204
+ drawerOffset: ' 256px' ,
183
205
drawerOptions: {
184
206
color: undefined ,
185
207
dark: false ,
208
+ expandOnHover: false ,
209
+ handleColor: ' primary' ,
186
210
handlePosition: ' center' ,
187
211
light: false ,
212
+ miniVariant: false ,
213
+ miniVariantWidth: 56 ,
188
214
overflow: false ,
189
215
resizable: true ,
190
216
right: false ,
217
+ saveWidth: true ,
191
218
stateless: false ,
219
+ storageName: ' v-resize-drawer-width' ,
192
220
touchless: false ,
193
221
width: undefined ,
194
-
195
- // storage //
196
- saveWidth: true ,
197
- storageName: ' v-resize-drawer-width' ,
198
-
199
- // mini-variant //
200
- expandOnHover: false ,
201
- miniVariant: false ,
202
- miniVariantWidth: 56 ,
203
222
},
204
- drawerOffset: ' 256px' ,
205
223
links: {
206
224
github: ' https://github.com/webdevnerdstuff' ,
207
225
npm: ' https://www.npmjs.com/package/vuetify-resize-drawer' ,
208
226
pnpm: ' https://pnpm.io/' ,
209
227
repo: ' https://github.com/webdevnerdstuff/vuetify-resize-drawer' ,
210
228
vue2: ' https://v2.vuejs.org' ,
211
- vuetify2: ' https://vuetifyjs.com/en' ,
229
+ vuetify2: ' https://v2. vuetifyjs.com/en' ,
212
230
},
231
+ mainContainerEl: null ,
213
232
unicornLog: {
233
+ prefix: ' [App.vue]' ,
214
234
styles: [
215
235
' background: black' ,
216
236
' color: magenta' ,
217
237
' padding: 5px' ,
218
238
],
219
- prefix: ' [App.vue]' ,
220
239
},
221
- mainContainerEl: null ,
222
240
}),
223
241
created () {
224
242
this .$bus .$on (' updateOptions' , (options ) => {
225
243
this .$unicornLog ({
226
- text: ' updateOptions' ,
227
- styles: this .unicornLog .styles ,
228
244
logPrefix: this .unicornLog .prefix ,
229
245
objects: options,
246
+ styles: this .unicornLog .styles ,
247
+ text: ' updateOptions' ,
230
248
});
231
249
232
250
this .drawerOptions = options;
@@ -237,26 +255,20 @@ export default {
237
255
this .getDarkLocalStorage ();
238
256
},
239
257
methods: {
240
- toggleDark () {
241
- this .dark = ! this .dark ;
242
- this .$vuetify .theme .dark = this .dark ;
243
- this .setDarkLocalStorage (this .dark );
244
- },
245
-
246
258
drawerClose (val ) {
247
259
this .$unicornLog ({
248
- text: ` drawerClose: ${ val} ` ,
249
- styles: this .unicornLog .styles ,
250
260
logPrefix: this .unicornLog .prefix ,
261
+ styles: this .unicornLog .styles ,
262
+ text: ` drawerClose: ${ val} ` ,
251
263
});
252
264
253
265
this .drawer = false ;
254
266
},
255
267
drawerInput (val ) {
256
268
this .$unicornLog ({
257
- text: ` drawerInput: ${ val} ` ,
258
- styles: this .unicornLog .styles ,
259
269
logPrefix: this .unicornLog .prefix ,
270
+ styles: this .unicornLog .styles ,
271
+ text: ` drawerInput: ${ val} ` ,
260
272
});
261
273
262
274
if (val) {
@@ -269,63 +281,68 @@ export default {
269
281
},
270
282
drawerTransitionend (evt ) {
271
283
this .$unicornLog ({
272
- text: ' drawerTransitionend' ,
273
- styles: this .unicornLog .styles ,
274
284
logPrefix: this .unicornLog .prefix ,
275
285
object: evt,
286
+ styles: this .unicornLog .styles ,
287
+ text: ' drawerTransitionend' ,
276
288
});
277
289
},
290
+ getDarkLocalStorage () {
291
+ const isDark = localStorage .getItem (' vuetify-resize-drawer-dark' );
292
+
293
+ this .dark = isDark === ' true' ;
294
+ this .$vuetify .theme .dark = this .dark ;
295
+ },
296
+ getLocalStorage () {
297
+ this .updateDrawerOffset (localStorage .getItem (this .drawerOptions .storageName ) || this .drawerOffset );
298
+ },
278
299
handleClick (evt ) {
279
300
this .$unicornLog ({
280
- text: ' handleClick' ,
281
- styles: this .unicornLog .styles ,
282
301
logPrefix: this .unicornLog .prefix ,
283
302
object: evt,
303
+ styles: this .unicornLog .styles ,
304
+ text: ' handleClick' ,
284
305
});
285
306
},
286
307
handleDoubleClick (evt ) {
287
308
this .$unicornLog ({
288
- text: ' handleDoubleClick' ,
289
- styles: this .unicornLog .styles ,
290
309
logPrefix: this .unicornLog .prefix ,
291
310
object: evt,
311
+ styles: this .unicornLog .styles ,
312
+ text: ' handleDoubleClick' ,
292
313
});
293
314
294
315
this .updateDrawerOffset (evt .offsetWidth );
295
316
},
317
+ handleDrag (evt ) {
318
+ this .updateDrawerOffset (evt .offsetWidth );
319
+ },
296
320
handleMousedown (evt ) {
297
321
this .$unicornLog ({
298
- text: ' handleMousedown' ,
299
- styles: this .unicornLog .styles ,
300
322
logPrefix: this .unicornLog .prefix ,
301
323
object: evt,
324
+ styles: this .unicornLog .styles ,
325
+ text: ' handleMousedown' ,
302
326
});
303
327
},
304
328
handleMouseup (evt ) {
305
329
this .$unicornLog ({
306
- text: ' handleMouseup' ,
307
- styles: this .unicornLog .styles ,
308
330
logPrefix: this .unicornLog .prefix ,
309
331
object: evt,
332
+ styles: this .unicornLog .styles ,
333
+ text: ' handleMouseup' ,
310
334
});
311
335
312
336
this .updateDrawerOffset (evt .offsetWidth );
313
337
},
314
- handleDrag (evt ) {
315
- this .updateDrawerOffset (evt .offsetWidth );
316
- },
317
- getLocalStorage () {
318
- this .updateDrawerOffset (localStorage .getItem (this .drawerOptions .storageName ) || this .drawerOffset );
319
- },
320
- getDarkLocalStorage () {
321
- const isDark = localStorage .getItem (' vuetify-resize-drawer-dark' );
322
-
323
- this .dark = isDark === ' true' ;
324
- this .$vuetify .theme .dark = this .dark ;
325
- },
326
338
setDarkLocalStorage (val ) {
327
339
localStorage .setItem (' vuetify-resize-drawer-dark' , val);
328
340
},
341
+ toggleDark () {
342
+ this .dark = ! this .dark ;
343
+ this .$vuetify .theme .dark = this .dark ;
344
+ this .setDarkLocalStorage (this .dark );
345
+ },
329
346
updateDrawerOffset (val ) {
330
347
this .drawerOffset = val;
331
348
},
@@ -334,8 +351,7 @@ export default {
334
351
</script >
335
352
336
353
<style lang="scss">
337
- @import ' prism-themes/themes/prism-night-owl.css' ;
338
- @import ' vue-code-highlight/themes/window.css' ;
354
+ @import ' vue-code-highlight/themes/prism-tomorrow.css' ;
339
355
340
356
html {
341
357
scroll-behavior : smooth ;
@@ -377,6 +393,14 @@ html {
377
393
}
378
394
}
379
395
396
+ code {
397
+ & .language-html ,
398
+ & .language-javascript ,
399
+ & .language-js {
400
+ background-color : transparent !important ;
401
+ }
402
+ }
403
+
380
404
.overflow-content {
381
405
right : -315px ;
382
406
position : fixed ;
0 commit comments