sidebar
This commit is contained in:
79
.vuepress/theme/components/Sidebar.vue
Normal file
79
.vuepress/theme/components/Sidebar.vue
Normal file
@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<aside class="sidebar">
|
||||
<slot name="top"/>
|
||||
<SidebarLinks :depth="0" :items="items"/>
|
||||
<slot name="bottom"/>
|
||||
<div style="text-align: center;">
|
||||
<strong>在线体验</strong>
|
||||
<div>
|
||||
<a target="_blank" href="http://demo.eip.work/#/login?isReadOnly=true&token=eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJvYXJkLXZpZXdlci10b2tlbi02djZiZiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJvYXJkLXZpZXdlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjhiYTU3YmI1LWFiMTctNDM1NS1hNTM0LTQ0Njk4NGY0NzFlZiIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprdWJvYXJkLXZpZXdlciJ9.DcXNIp0RKha1zkV4ga_QlGfcvMLGx2LOyzX-0VeboC3FojKFhxnfBeoda-zTeh6ugJlSM4kQYrRcof1Kx8Mg3-UgofNmgRySbDEVKtJZyMUoHqLmySKUIn8sbX8q83RNcqwcvY-fM8-w8HSuzU7Td7WWNuZrlCL4q_LQDYIBet1nlQ83YsENKNE8rsZQFDw8YM0MH6BEZLdwyhaboy_jjYbsU7kv8gks3aIX4lh1Fs9ZFQpC_6B0_MZvb7rEeG2M8QWXoUkDoL5JCKu6Wot5GlWf0kDMxIsViggP0NmSDTKh6kIvCkT2FZ2I4guEcjE_EjBpdOS6Abta22tzLlPKhg">
|
||||
<p>
|
||||
<img :src="demo_img"></img>
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<strong>在线提问</strong>
|
||||
<p>
|
||||
<img :src="kuboard_qq_img"/>
|
||||
</p>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SidebarLinks from '@theme/components/SidebarLinks.vue'
|
||||
import kuboard_qq from './kuboard_qq.png'
|
||||
import demo from './image-20190723104717575.png'
|
||||
|
||||
export default {
|
||||
name: 'Sidebar',
|
||||
|
||||
props: ['items'],
|
||||
components: { SidebarLinks },
|
||||
data () {
|
||||
return {
|
||||
kuboard_qq_img: kuboard_qq,
|
||||
demo_img: demo
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
.sidebar
|
||||
ul
|
||||
padding 0
|
||||
margin 0
|
||||
list-style-type none
|
||||
a
|
||||
display inline-block
|
||||
.nav-links
|
||||
display none
|
||||
border-bottom 1px solid $borderColor
|
||||
padding 0.5rem 0 0.75rem 0
|
||||
a
|
||||
font-weight 600
|
||||
.nav-item, .repo-link
|
||||
display block
|
||||
line-height 1.25rem
|
||||
font-size 1.1em
|
||||
padding 0.5rem 0 0.5rem 1.5rem
|
||||
& > .sidebar-links
|
||||
padding 1.5rem 0
|
||||
& > li > a.sidebar-link
|
||||
font-size 1.1em
|
||||
line-height 1.7
|
||||
font-weight bold
|
||||
& > li:not(:first-child)
|
||||
margin-top .75rem
|
||||
|
||||
@media (max-width: $MQMobile)
|
||||
.sidebar
|
||||
.nav-links
|
||||
display block
|
||||
.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after
|
||||
top calc(1rem - 2px)
|
||||
& > .sidebar-links
|
||||
padding 1rem 0
|
||||
</style>
|
||||
BIN
.vuepress/theme/components/image-20190723104717575.png
Normal file
BIN
.vuepress/theme/components/image-20190723104717575.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
.vuepress/theme/components/kuboard_qq.png
Normal file
BIN
.vuepress/theme/components/kuboard_qq.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@ -1,26 +1,60 @@
|
||||
<template>
|
||||
<ParentLayout>
|
||||
<!-- <div slot="sidebar-top">
|
||||
<p class="header-description">
|
||||
A cool Kubernetes Dashboard
|
||||
</p>
|
||||
</div> -->
|
||||
<div slot="page-bottom" class="header-description">Copyright © 2019-present HuanQing Shao</div>
|
||||
<div slot="sidebar-top">
|
||||
<div style="text-align: center; margin-top: 20px;">
|
||||
<div class="side-nav-item" :style="activeLinkStyle('/overview/') + 'margin-left: 0;'">
|
||||
<a href="/overview/" class="nav-link">简介</a>
|
||||
</div>
|
||||
<div class="side-nav-item" :style="activeLinkStyle('/install/')">
|
||||
<a href="/install/" class="nav-link router-link-exact-active router-link-active">安装</a>
|
||||
</div>
|
||||
<div class="side-nav-item" :style="activeLinkStyle('/guide/')">
|
||||
<a href="/guide/" class="nav-link">使用</a>
|
||||
</div>
|
||||
<div class="side-nav-item" :style="activeLinkStyle('/support/')">
|
||||
<a href="/support/" class="nav-link">支持</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="page-bottom" class="bottom-description">Copyright © 2019-present HuanQing Shao</div>
|
||||
</ParentLayout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ParentLayout from '@parent-theme/layouts/Layout.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ParentLayout
|
||||
},
|
||||
methods: {
|
||||
activeLinkStyle(href) {
|
||||
if (this.$page.path.indexOf(href) === 0) {
|
||||
return 'border-bottom: 2px solid #0b85ff;'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.header-description {
|
||||
padding: 0px;
|
||||
.bottom-description {
|
||||
text-align: center;
|
||||
font-size: 0.8rem;
|
||||
color: #909399;
|
||||
}
|
||||
.side-nav-item {
|
||||
margin-bottom: -2px;
|
||||
margin-left: 20px;
|
||||
display: inline-block;
|
||||
line-height: 1.4rem;
|
||||
white-space: nowrap;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.side-nav-item a {
|
||||
color: #2c3e50;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user