feat: add toc
This commit is contained in:
parent
5240cfd31b
commit
f69013b752
@ -5,6 +5,7 @@ margin-y($top, $bottom = $top)
|
|||||||
margin-bottom $bottom
|
margin-bottom $bottom
|
||||||
|
|
||||||
.post
|
.post
|
||||||
|
position relative
|
||||||
padding 30px 60px
|
padding 30px 60px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
line-height 1.8
|
line-height 1.8
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<nav class="one-toc">
|
<nav class="one-toc">
|
||||||
<veui-anchor
|
<veui-anchor
|
||||||
:items="flattenItems"
|
ui="s"
|
||||||
sticky
|
sticky
|
||||||
|
:items="flattenItems"
|
||||||
/>
|
/>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
@ -25,8 +26,3 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
|
||||||
.one-toc
|
|
||||||
float right
|
|
||||||
</style>
|
|
||||||
|
@ -110,4 +110,11 @@ main
|
|||||||
min-width 0
|
min-width 0
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="stylus">
|
||||||
|
.one-toc
|
||||||
|
position absolute
|
||||||
|
left 100%
|
||||||
|
top 120px
|
||||||
|
</style>
|
||||||
|
|
||||||
<style lang="stylus" src="@/assets/styles/post.styl"></style>
|
<style lang="stylus" src="@/assets/styles/post.styl"></style>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<article ref="article" class="content ${style}">
|
<article ref="article" class="content ${style}"><!-- if: ${toc} -->
|
||||||
|
<one-toc :items="toc"/><!-- /if -->
|
||||||
${content | raw}
|
${content | raw}
|
||||||
<section class="meta">
|
<section class="meta">
|
||||||
<one-edit-link path="${path}"/>
|
<one-edit-link path="${path}"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user