add active state to children text links

This commit is contained in:
axolotle
2021-03-10 18:37:52 +01:00
parent 206e297576
commit 60f713caa1
2 changed files with 9 additions and 3 deletions
+4 -2
View File
@@ -14,10 +14,11 @@
</template> </template>
</h4> </h4>
<b-nav class="ml-auto flex-nowrap"> <b-nav class="ml-auto flex-nowrap" pills>
<b-nav-item <b-nav-item
v-for="child in text.children" :key="child.id" v-for="child in text.children" :key="child.id"
@click="$emit('open', id, child.id)" @click="$emit('open', id, child.id)"
:active="children.includes(child.id)"
> >
{{ child.id }} {{ child.id }}
</b-nav-item> </b-nav-item>
@@ -67,7 +68,8 @@ export default {
name: 'TextCard', name: 'TextCard',
props: { props: {
id: { type: Number, required: true } id: { type: Number, required: true },
children: { type: Array, default: null }
}, },
data () { data () {
+5 -1
View File
@@ -5,7 +5,11 @@
<!-- FOREGROUND (texts) --> <!-- FOREGROUND (texts) -->
<section v-for="parent in parents" :key="parent.id" class="split-screen"> <section v-for="parent in parents" :key="parent.id" class="split-screen">
<text-card :id="parent.id" @open="openText" @close="closeText" /> <text-card
:id="parent.id"
:children="parent.children"
@open="openText" @close="closeText"
/>
<div> <div>
<text-card <text-card
v-for="id in parent.children" :key="id" v-for="id in parent.children" :key="id"