提交 c6c71aff 编写于 作者: U ULIVZ 提交者: Evan You

feat(sidebar): support click the part outside sidebar to close the sidebar. (#132)

上级 fd447aea
......@@ -4,6 +4,7 @@
@touchstart="onTouchStart"
@touchend="onTouchEnd">
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar"/>
<div class="sidebar-mask" @click="toggleSidebar(false)"></div>
<Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar"/>
<div class="custom-layout" v-if="$page.frontmatter.layout">
<component :is="$page.frontmatter.layout"/>
......
......@@ -29,6 +29,15 @@ body
box-sizing border-box
border-bottom 1px solid $borderColor
.sidebar-mask
position fixed
z-index 9
top 0
left 0
width 100vw
height 100vh
display none
.sidebar
font-size 15px
background-color #fff
......@@ -153,11 +162,16 @@ th, td
.custom-layout
padding-top $navbarHeight
.theme-container.no-navbar
.content:not(.custom)
h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0
.theme-container
&.sidebar-open
.sidebar-mask
display: block
&.no-navbar
.content:not(.custom)
h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0
@media (min-width: ($MQMobile + 1px))
.theme-container.no-sidebar
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册