some refactoring, better toc

This commit is contained in:
2020-07-07 11:56:22 +02:00
parent c6cbed0ebf
commit 55e99290a2
7 changed files with 33 additions and 20 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
<section>
<ul>
<li
v-for="item in content"
v-for="item in toc"
:key="item.uuid"
>
<TocItem :item="item" :level="1" :editionid="$route.params.id" />
@@ -21,7 +21,7 @@ export default {
TocItem
},
props: {
content: Object
toc: Array
},
data: () => ({
+3 -3
View File
@@ -8,7 +8,7 @@
v-if="title"
class="toc-title"
:uuid="item.uuid"
v-bind:class="{active: isActive}"
:class="{active: isActive}"
>
<a
:href="'/edition/'+editionid+'/'+item.uuid"
@@ -22,7 +22,7 @@
<ul
v-if="children.length"
class="toc-list"
v-bind:class="{opened: isOpened}"
:class="{opened: isOpened}"
>
<li v-for="child in children" :key="child.uuid">
<TocItem :item="child" :level="nextLevel" :editionid="editionid" />
@@ -92,7 +92,7 @@ export default {
onclick (e) {
console.log('clicked on toc text', this.editionid, e)
this.$router.push({
name: `editiontoctext`,
name: `editiontext`,
params: {
id: this.editionid,
textid: e.target.getAttribute('uuid')