mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-10-30 05:04:21 +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>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@ export default {
|
|||
|
||||
components: {
|
||||
Spell
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.commit('setHasRightDrawer', false)
|
||||
this.$store.commit('setRightDrawer', false)
|
||||
this.$store.commit('setInRightDrawer', null)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
>
|
||||
|
||||
<template v-slot:item.title="{ item }">
|
||||
<router-link :to="{ path: item.path }">{{ item.title }}</router-link>
|
||||
<router-link :to="{ path: item.path }" class="subtitle-2">{{ item.title }}</router-link>
|
||||
</template>
|
||||
|
||||
<template v-slot:item.frontmatter.level="{ item }">
|
||||
|
|
@ -165,5 +165,18 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="scss">
|
||||
@import '../styles/colors';
|
||||
|
||||
.v-data-table {
|
||||
a {
|
||||
color: $color-dragon;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.v-data-table__mobile-row {
|
||||
min-height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue