This commit is contained in:
xugaoyi 2020-12-15 15:59:42 +08:00
parent a306a030b9
commit 8a75b5bb65
6 changed files with 20 additions and 10 deletions

View File

@ -73,6 +73,7 @@ module.exports = {
// showToArticle: true, // 显示到文章页底部默认true // showToArticle: true, // 显示到文章页底部默认true
// moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives' // moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives'
// }, // },
// rightMenuBar: false, // 是否显示右侧文章大纲栏默认true (屏宽小于1300px下无论如何都不显示)
// sidebarOpen: false, // 初始状态是否打开侧边栏默认true // sidebarOpen: false, // 初始状态是否打开侧边栏默认true
// pageButton: false, // 是否显示快捷翻页按钮默认true // pageButton: false, // 是否显示快捷翻页按钮默认true

View File

@ -22,7 +22,7 @@
"vuepress-plugin-one-click-copy": "^1.0.2", "vuepress-plugin-one-click-copy": "^1.0.2",
"vuepress-plugin-thirdparty-search": "^1.0.2", "vuepress-plugin-thirdparty-search": "^1.0.2",
"vuepress-plugin-zooming": "^1.1.7", "vuepress-plugin-zooming": "^1.1.7",
"vuepress-theme-vdoing": "^1.6.2", "vuepress-theme-vdoing": "^1.6.3",
"yamljs": "^0.3.0" "yamljs": "^0.3.0"
}, },
"dependencies": { "dependencies": {

View File

@ -72,7 +72,13 @@ export default {
return !this.$frontmatter.pageComponent return !this.$frontmatter.pageComponent
}, },
showRightMenu () { showRightMenu () {
return this.$page.headers && (this.$frontmatter && this.$frontmatter.sidebar && this.$frontmatter.sidebar !== false) !== false const { $frontmatter, $themeConfig, $page } = this
const { sidebar } = $frontmatter
return (
$themeConfig.rightMenuBar !== false &&
$page.headers &&
($frontmatter && sidebar && sidebar !== false) !== false
)
}, },
pageComponent () { pageComponent () {
return this.$frontmatter.pageComponent ? this.$frontmatter.pageComponent.name : false return this.$frontmatter.pageComponent ? this.$frontmatter.pageComponent.name : false
@ -138,9 +144,11 @@ export default {
.page .page
padding-right 0.8rem !important padding-right 0.8rem !important
@media (max-width 1279px) @media (max-width 1279px)
.right-menu-wrapper .have-rightmenu
display none .right-menu-wrapper
display none
@media (min-width 1280px) @media (min-width 1280px)
.sidebar .sidebar-sub-headers .have-rightmenu
display none .sidebar .sidebar-sub-headers
display none
</style> </style>

View File

@ -81,12 +81,12 @@ export default {
&.is-sub-group &.is-sub-group
padding-left 0 padding-left 0
& > .sidebar-heading & > .sidebar-heading
font-size 1em font-size 1.01em
line-height 1.4 line-height 1.4
font-weight normal font-weight bold
padding-left 2rem padding-left 2rem
&:not(.clickable) &:not(.clickable)
opacity 0.5 // opacity 0.9
& > .sidebar-group-items & > .sidebar-group-items
padding-left 1rem padding-left 1rem
& > li > .sidebar-link & > li > .sidebar-link

View File

@ -102,6 +102,7 @@ export default {
const { headers } = this.$page const { headers } = this.$page
return ( return (
!this.$frontmatter.home !this.$frontmatter.home
&& this.$themeConfig.rightMenuBar !== false
&& headers && headers
&& headers.length && headers.length
&& this.$frontmatter.sidebar !== false && this.$frontmatter.sidebar !== false

View File

@ -1,6 +1,6 @@
{ {
"name": "vuepress-theme-vdoing", "name": "vuepress-theme-vdoing",
"version": "1.6.2", "version": "1.6.3",
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。", "description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
"author": { "author": {
"name": "gaoyi(Evan) Xu" "name": "gaoyi(Evan) Xu"