File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <Toc class =" docs-anchor" />
3+ </template >
4+
5+ <style lang="scss">
6+ .vuepress-toc.docs-anchor {
7+ position : fixed ;
8+ top : 115px ;
9+ right : 20px ;
10+ ul .vuepress-toc-list {
11+ list-style : none ;
12+ font-size : 12px ;
13+ max-width : 125px ;
14+ min-width : 92px ;
15+ max-height : 80vh ;
16+ border-left : 1px solid var (--c-border-dark );
17+ margin : 0 ;
18+ li .vuepress-toc-item {
19+ a {
20+ color : var (--text-color );
21+ opacity : 0.85 ;
22+ & :hover {
23+ opacity : 1 ;
24+ color : var (--c-text-accent );
25+ transition : all 0.3s ;
26+ }
27+ }
28+ a .router-link-active.active {
29+ color : var (--c-text-accent );
30+ }
31+ & :not (:last-child ) {
32+ margin-bottom : 4px ;
33+ }
34+ & :empty ,
35+ & > .vuepress-toc-list {
36+ display : none ;
37+ }
38+ }
39+ }
40+ }
41+ ul .vuepress-toc-list > li .vuepress-toc-item :nth-last-child (1 ):first-child {
42+ // 只有一个item时隐藏
43+ display : none ;
44+ }
45+ @media only screen and (max-width : 1280px ) {
46+ .docs-anchor {
47+ display : none ;
48+ }
49+ }
50+ </style >
Original file line number Diff line number Diff line change 11<template >
22 <Layout >
3+ <template #page-top >
4+ <Anchor v-show =" anchorRight" />
5+ </template >
36 <template #page-bottom >
47 <footer class =" docs-footer page-meta" >
58 <div :class =" $style.footerContainer" role =" presentation" >
1316</template >
1417
1518<script setup lang="ts">
19+ import { ref } from ' vue'
20+ import { usePageFrontmatter } from ' @vuepress/client'
1621import Layout from ' @vuepress/theme-default/lib/client/layouts/Layout.vue'
22+
23+ const frontmatter = usePageFrontmatter ()
24+ const anchorRight = ref (frontmatter .value .anchorRight ?? true )
1725 </script >
1826
1927<style module lang="scss">
You can’t perform that action at this time.
0 commit comments