This commit is contained in:
xugaoyi 2021-10-30 18:34:03 +08:00
parent 194dcd2338
commit 5e45eaf901
4 changed files with 18 additions and 15 deletions

View File

@ -42,7 +42,6 @@ module.exports = {
// rightMenuBar: false, // 是否显示右侧文章大纲栏默认true (屏宽小于1300px下无论如何都不显示)
// sidebarOpen: false, // 初始状态是否打开侧边栏默认true
// pageButton: false, // 是否显示快捷翻页按钮默认true
// sidebarHoverTriggerOpen: false, // 当侧边栏关闭时是否允许鼠标滑动到左侧边弹出侧边栏默认true
sidebar: 'structuring', // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页

View File

@ -7,8 +7,8 @@
"deploy": "bash deploy.sh",
"editFm": "node utils/editFrontmatter.js",
"baiduPush": "node utils/baiduPush.js https://xugaoyi.com && bash baiduPush.sh",
"publish": "cd ./theme-vdoing && npm publish && cd ../ && npm run updateTheme",
"updateTheme": "npm uninstall vuepress-theme-vdoing && rm -rf node_modules && npm i && npm i vuepress-theme-vdoing -D"
"publish": "cd ./theme-vdoing && npm publish && cd .. && yarn updateTheme",
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D"
},
"license": "MIT",
"devDependencies": {
@ -22,7 +22,7 @@
"vuepress-plugin-one-click-copy": "^1.0.2",
"vuepress-plugin-thirdparty-search": "^1.0.2",
"vuepress-plugin-zooming": "^1.1.7",
"vuepress-theme-vdoing": "^1.8.4",
"vuepress-theme-vdoing": "^1.8.5",
"yamljs": "^0.3.0"
},
"dependencies": {

View File

@ -3,11 +3,15 @@
<div class="right-menu-margin">
<div class="right-menu-content">
<div
:class="['right-menu-item', 'level'+item.level, { active: item.slug === hashText }]"
:class="[
'right-menu-item',
'level' + item.level,
{ active: item.slug === hashText }
]"
v-for="(item, i) in headers"
:key="i"
>
<a :href="'#'+item.slug">{{item.title}}</a>
<a :href="'#' + item.slug">{{ item.title }}</a>
</div>
</div>
</div>
@ -16,27 +20,27 @@
<script>
export default {
data () {
data() {
return {
headers: [],
hashText: ''
}
},
mounted () {
mounted() {
this.getHeadersData()
this.getHashText()
},
watch: {
$route () {
$route() {
this.headers = this.$page.headers
this.getHashText()
}
},
methods: {
getHeadersData () {
getHeadersData() {
this.headers = this.$page.headers
},
getHashText () {
getHashText() {
this.hashText = decodeURIComponent(window.location.hash.slice(1))
}
}
@ -52,7 +56,7 @@ export default {
top 0
font-size 0.9rem
.right-menu-margin
margin-top ($navbarHeight + 1rem)
margin-top: ($navbarHeight + 1rem)
.right-menu-content
max-height 80vh
position relative
@ -65,7 +69,7 @@ export default {
overflow-y auto
.right-menu-item
padding 4px 15px
border-left 0.13rem solid var(--borderColor)
border-left 1px solid var(--borderColor)
&.level3
padding-left 28px
&.active
@ -77,7 +81,7 @@ export default {
color var(--textColor)
opacity 0.75
display block
width ($rightMenuWidth - 30px)
width: ($rightMenuWidth - 30px)
&:hover
color $accentColor
.have-body-img

View File

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