Skip to content

Commit 6315b5e

Browse files
authored
Merge pull request coreui#18 from joefresco/patch-2
Mobile sidebar link click should close the sidebar
2 parents 240e8db + e64c0a0 commit 6315b5e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Vue_Full_Project/src/components/SidebarNavLink.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
</div>
88
<div v-else>
99
<router-link :to="url" :class="classList">
10-
<i :class="icon"></i> {{name}}
11-
<b-badge v-if="badge && badge.text" :variant="badge.variant">{{badge.text}}</b-badge>
10+
<span @click="hideMobile">
11+
<i :class="icon"></i> {{name}}
12+
<b-badge v-if="badge && badge.text" :variant="badge.variant">{{badge.text}}</b-badge>
13+
</span>
1214
</router-link>
1315
</div>
1416
</template>
@@ -63,6 +65,13 @@
6365
return false
6466
}
6567
}
68+
},
69+
methods: {
70+
hideMobile () {
71+
if (document.body.classList.contains('sidebar-mobile-show')) {
72+
document.body.classList.toggle('sidebar-mobile-show')
73+
}
74+
}
6675
}
6776
}
6877
</script>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy