File tree Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 5
5
:class =" {
6
6
show: sidebarState,
7
7
}"
8
- :toggle-sidebar =" toggleSidebar"
8
+ :toggle-sidebar =" closeSidebar"
9
+ :is-mobile =" screenWidth < 780"
9
10
/>
10
11
<div
11
12
v-if =" showSidebar && screenWidth < 780 && sidebarState"
@@ -39,6 +40,9 @@ const showFooter = computed(() => router.currentRoute.value.meta.footer);
39
40
const toggleSidebar = () => {
40
41
sidebarState .value = ! sidebarState .value ;
41
42
};
43
+ const closeSidebar = () => {
44
+ sidebarState .value = false ;
45
+ };
42
46
43
47
const screenWidth = ref (0 );
44
48
onMounted (() => {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ defineProps<{
12
12
</button >
13
13
<h1 ><router-link to =" /" class =" !no-underline" >Vue Formik</router-link ></h1 >
14
14
<div class =" grow" />
15
+ <router-link to =" /about" >About</router-link >
15
16
<a href =" https://github.com/vue-formik/vue-formik" target =" _blank" > ⭐ Star us on GitHub </a >
16
17
</div >
17
18
</nav >
@@ -40,7 +41,7 @@ defineProps<{
40
41
a
41
42
color : white
42
43
text-decoration : none
43
- @apply text-sm
44
+ @apply text-sm px-2 mx-2
44
45
& :hover
45
46
text-decoration : underline
46
47
</style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <aside class =" the-sidebar" >
2
+ <aside
3
+ class =" the-sidebar"
4
+ :style =" {
5
+ paddingLeft: isMobile ? '2rem' : '1rem',
6
+ }"
7
+ >
8
+ <button
9
+ v-if =" isMobile"
10
+ class =" absolute top-1 right-1 text-xs"
11
+ title =" Close Sidebar"
12
+ @click =" toggleSidebar"
13
+ >
14
+ <span >Close</span >
15
+ </button >
3
16
<ul class =" flex flex-col gap-2" >
4
17
<template v-for =" (item , index ) in TheSidebarItems " :key =" index " >
5
18
<li >
@@ -26,20 +39,22 @@ import TheSidebarItems from "@/constants/theSidebarItems.ts";
26
39
27
40
defineProps <{
28
41
toggleSidebar: () => void ;
42
+ isMobile: boolean ;
29
43
}>();
30
44
</script >
31
45
32
46
<style lang="sass">
33
47
.the-sidebar
34
- @apply pt-4 pl-2
48
+ @apply pt-4 relative
35
49
@apply border-r border-surface-b
36
50
37
51
ul
38
52
li
39
- @apply px-2 text-sm
53
+ @apply mb-1
40
54
& > p
41
- @apply mt-5 mb-1 .5 text-xs
55
+ @apply mt-5 mb-2 text-xs
42
56
a
57
+ @apply px-2 py-1 text-sm
43
58
@apply text-gray-400 rounded
44
59
@apply transition-all duration-200 ease-in-out
45
60
& :hover
@@ -48,6 +63,4 @@ defineProps<{
48
63
@apply text-white brightness-90
49
64
& .router-link-exact-active
50
65
@apply text-primary
51
- ul li
52
- @apply mb-1.5
53
66
</style >
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ export default [
4
4
children : [
5
5
{ name : "Introduction" , path : "/getting-started/introduction" } ,
6
6
{ name : "Quick Start" , path : "/getting-started/quick-start" } ,
7
- { name : "Quick Start" , path : "/getting-started/why" } ,
8
7
] ,
9
8
} ,
10
9
{
Original file line number Diff line number Diff line change 7
7
8
8
<section class =" mb-12" >
9
9
<div class =" flex gap-4 justify-center items-center" >
10
- <router-link class =" primary-btn md" to =" /getting-started/introduction"
11
- >Why Vue-Formik?</ router-link
12
- >
10
+ <router-link class =" primary-btn md" to =" /getting-started/introduction" >
11
+ Introduction
12
+ </ router-link >
13
13
<router-link class =" secondary-btn md" to =" /getting-started/quick-start" >
14
14
Get Started
15
15
</router-link >
You can’t perform that action at this time.
0 commit comments