mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-12-17 15:40:37 +00:00
table of contents in pages
This commit is contained in:
parent
f415fa8613
commit
a6e1803b23
12 changed files with 165 additions and 10 deletions
|
|
@ -15,6 +15,30 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
},
|
||||
|
||||
methods: {
|
||||
setRightDrawer () {
|
||||
this.$store.commit('setHasRightDrawer', false)
|
||||
this.$store.commit('setRightDrawer', false)
|
||||
this.$store.commit('setInRightDrawer', null)
|
||||
|
||||
if (this.$page.headers && this.$page.headers.length > 0 && this.$page.frontmatter.toc !== false) {
|
||||
this.$store.commit('setHasRightDrawer', true)
|
||||
this.$store.commit('setRightDrawer', true)
|
||||
this.$store.commit('setInRightDrawer', 'pageToc')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
$route (id) {
|
||||
this.setRightDrawer()
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.setRightDrawer()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue