1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-31 05:24:20 +00:00

table of contents in pages

This commit is contained in:
Maxime Moraine 2020-04-02 14:20:33 +02:00
parent f415fa8613
commit a6e1803b23
12 changed files with 165 additions and 10 deletions

View file

@ -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>