I'm attempting to create multiple v-dividers based on the number of answers I have, so that there is a divider for each answer (4). Following an example from the official documentation, I'm trying something like this but I seem to be stuck. Could someone please point out where I am going wrong? https://i.sstatic.net/zftiC.png
Below is the code snippet:
<template>
<div class="dark2">
<v-card max-width="600" class="mx-auto">
<v-toolbar extended class="mt-10" color="light-blue" dark>
<v-toolbar-title class="flex text-center">
<h2 class="text-center mt-10">Quiz Dark 2</h2>
</v-toolbar-title>
</v-toolbar>
<v-progress-linear :value="progress"></v-progress-linear>
<v-list subheader two-line v-for="(element, index) in questions.slice(a,b)" :key="index" v-show="quiz">
<h1 class="text-center my-4">Question {{ b }}/{{ questions.length }}</h1>
<v-list-item class="d-flex justify-center text-center">{{ element.question }}</v-list-item>
<v-divider class="mt-10"></v-divider>
<v-list-item-group active-class="pink--text">
<v-list-item class="d-flex justify-center my-2" v-for="(item, index) in element.suggestions" :key="index">
{{ item.suggestion }}
</v-list-item>
<v-divider v-if="index < questions.length - 1"
:key="index"></v-divider>
</v-list-item-group>
</v-list>
</v-card>
</div>
</template>
<script>
export default {
data() {
return {
questions: [
{
question: 'What does Michael Kahnwald leave for his son Jonas before hanging himself?',
suggestions: [
{suggestion: 'A book'},
{suggestion: 'A letter'},
{suggestion: 'A futuristic torch'},
{suggestion: 'A Geiger counter'}
]
}
],
a: 0,
b: 1,
select: false,
score: 0,
quiz: true,
score_show: false,
next: false,
progress: 0
}
}
}
</script>