feat: show nav contents in sidebar when mobile

pull/80/head
小倉優悟 5 years ago
parent d307053e4e
commit 042177249a

@ -12,7 +12,7 @@
/> />
<span>{{ $site.title }}</span> <span>{{ $site.title }}</span>
</a> </a>
<NavBarLinks /> <NavBarLinks class="hide-mobile"/>
</template> </template>
<script src="./NavBar"></script> <script src="./NavBar"></script>
@ -29,4 +29,10 @@
height: 1.3rem; height: 1.3rem;
vertical-align: bottom; vertical-align: bottom;
} }
@media screen and (max-width: 719px) {
.hide-mobile {
display: none;
}
}
</style> </style>

@ -25,7 +25,7 @@
} }
.nav-link { .nav-link {
display: inline-block; display: block;
margin-bottom: -2px; margin-bottom: -2px;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
font-size: 0.9rem; font-size: 0.9rem;

@ -20,7 +20,8 @@
@media screen and (max-width: 719px) { @media screen and (max-width: 719px) {
.nav-links { .nav-links {
display: none; display: block;
height: auto;
} }
} }
</style> </style>

@ -46,7 +46,7 @@
.dropdown-wrapper { .dropdown-wrapper {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
display: inline-block; display: block;
margin-left: 1.5rem; margin-left: 1.5rem;
} }
.dropdown-wrapper .dropdown-title { .dropdown-wrapper .dropdown-title {

@ -9,6 +9,7 @@ import { Header } from '../../../../types/shared'
import { isActive, joinUrl, getPathDirName } from '../utils' import { isActive, joinUrl, getPathDirName } from '../utils'
import { DefaultTheme } from '../config' import { DefaultTheme } from '../config'
import { useActiveSidebarLinks } from '../composables/activeSidebarLink' import { useActiveSidebarLinks } from '../composables/activeSidebarLink'
import NavBarLinks from './NavBarLinks.vue'
const SideBarItem: FunctionalComponent<{ const SideBarItem: FunctionalComponent<{
item: ResolvedSidebarItem item: ResolvedSidebarItem
@ -33,6 +34,7 @@ const SideBarItem: FunctionalComponent<{
export default { export default {
components: { components: {
NavBarLinks,
SideBarItem SideBarItem
}, },

@ -1,4 +1,5 @@
<template> <template>
<NavBarLinks class="show-mobile"/>
<ul class="sidebar"> <ul class="sidebar">
<SideBarItem v-for="item of items" :item="item" /> <SideBarItem v-for="item of items" :item="item" />
</ul> </ul>
@ -7,6 +8,15 @@
<script src="./SideBar"></script> <script src="./SideBar"></script>
<style> <style>
.show-mobile {
display: none;
}
@media screen and (max-width: 719px) {
.show-mobile {
display: block;
}
}
.sidebar, .sidebar,
.sidebar-items { .sidebar-items {
list-style-type: none; list-style-type: none;

Loading…
Cancel
Save