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