misc, text & toc display

This commit is contained in:
2020-07-06 15:03:02 +02:00
parent e6beb65a74
commit 5691b071a1
8 changed files with 203 additions and 90 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div id="text">
<h1>{{ textdata.content.title }}</h1>
<!-- <h1>{{ textdata.meta.title }}</h1> -->
<div class="tei" v-html="textdata.content.tei" />
</div>
</template>
+33
View File
@@ -0,0 +1,33 @@
<template>
<section>
<ul>
<li
v-for="item in content"
:key="item.uuid"
>
<TocItem :item="item" :level="1" :editionid="$route.params.id" />
</li>
</ul>
</section>
</template>
<script>
import TocItem from './TocItem'
export default {
name: 'EdToc',
components: {
TocItem
},
props: {
content: Object
},
data: () => ({
})
}
</script>
<style lang="scss" scoped>
</style>
+14 -1
View File
@@ -8,6 +8,7 @@
v-if="title"
class="toc-title"
:uuid="item.uuid"
v-bind:class="{active: isActive}"
>
<a
:href="'/edition/'+editionid+'/'+item.uuid"
@@ -18,7 +19,11 @@
{{ title }}
</a>
</component>
<ul v-if="children.length">
<ul
v-if="children.length"
class="toc-list"
v-bind:class="{opened: isOpened}"
>
<li v-for="child in children" :key="child.uuid">
<TocItem :item="child" :level="nextLevel" :editionid="editionid" />
</li>
@@ -62,6 +67,14 @@ export default {
},
nextLevel () {
return this.level + 1
},
isActive () {
// console.log('Active', this.$route.params.textid, this.item.uuid)
return this.$route.params.textid === this.item.uuid
},
isOpened () {
// console.log('opened', this.$route.params.textid.indexOf(this.item.uuid) >= 0)
return this.$route.params.textid.indexOf(this.item.uuid) >= 0
}
},
// beforeCreate () {