quiz clickable label

This commit is contained in:
polv committed 2026-07-06 08:30:41 +07:00
1 parent f3c3b2bbb3
commit 2b62c9b9e0
1 file changed
+14 -6
+14 -6
View File
@@ -38,21 +38,23 @@
<span>{{ example.en }}</span> <span>{{ example.en }}</span>
</details> </details>
</nav> </nav>
<details> <details :class="$style.options">
<summary>Quiz options</summary> <summary>Quiz options</summary>
<nav> <nav>
<span v-for="c in vCats" :key="c"> <label v-for="c in vCats" :key="c">
<input type="checkbox" :name="c" checked @change="updateCats(c)" /> <input type="checkbox" :name="c" checked @change="updateCats(c)" />
<label :for="c"> {{ c }} </label> {{ c }}
</span> </label>
</nav> </nav>
<nav> <nav>
<label>
<input <input
type="checkbox" type="checkbox"
name="autoplay-audio" name="autoplay-audio"
v-model="vSentAutoplayAudio" v-model="vSentAutoplayAudio"
/> />
<label for="autoplay-audio">autoplay sentence audio</label> autoplay sentence audio
</label>
</nav> </nav>
</details> </details>
</div> </div>
@@ -138,7 +140,7 @@ function mark(isRight: boolean) {
vList.value = [...vList.value.filter((_, i) => i !== vIndex.value)]; vList.value = [...vList.value.filter((_, i) => i !== vIndex.value)];
vIndex.value = -1; vIndex.value = -1;
if (vList.value.length === 0) { if (vList.value.length <= 1) {
makeVList(); makeVList();
return; return;
} }
@@ -175,4 +177,10 @@ function updateCats(cat: string) {
margin-inline-start: 1em; margin-inline-start: 1em;
} }
} }
.options {
label + label {
margin-inline-start: 0.5em;
}
}
</style> </style>