refactor [P-36]: добавление картинок к ответам

This commit is contained in:
Denzel committed 2025-02-19 14:44:01 +03:00
1 parent a33f64835f
commit 72a4834e77
1 file changed
+35 -12
@@ -1,11 +1,13 @@
/* eslint-disable vue/no-mutating-props */
<template>
<v-card class="mt-4 w-75 mx-auto d-flex flex-lg-column" style="min-height: 350px">
<v-card
class="mt-4 w-75 mx-auto d-flex flex-lg-column"
style="min-height: 450px; max-height: 700px"
>
<v-card-title class="text-h6 font-weight-bold">
Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }}
</v-card-title>
<v-card-text>
<h3 class="mb-4">{{ question.name }}</h3>
<h3 class="mb-2 px-4">{{ question.name }}</h3>
<v-card-text style="overflow-y: scroll">
<v-img
v-if="question.file"
:src="`http://127.0.0.1:8000${question.file}`"
@@ -14,12 +16,20 @@
<!-- Одиночный выбор -->
<v-radio-group v-if="!isMultipleChoice" v-model="answers[currentQuestion]">
<v-radio
v-for="(option, index) in question.answers"
:key="index"
:label="option.name"
:value="option.name"
/>
<v-radio v-for="(option, index) in question.answers" :key="index">
<template v-slot:label>
<div class="text-center">
<v-img
v-if="option.file"
:src="`http://127.0.0.1:8000${option.file}`"
class="mb-4"
max-height="140"
contain
/>
<span>{{ option.name }}</span>
</div>
</template>
</v-radio>
</v-radio-group>
<!-- Множественный выбор -->
@@ -28,9 +38,22 @@
v-for="(option, index) in question.answers"
:key="index"
v-model="answers[currentQuestion]"
:label="option.name"
:value="option.name"
/>
style="margin-bottom: -25px"
>
<template v-slot:label>
<div class="text-center">
<v-img
v-if="option.file"
:src="`http://127.0.0.1:8000${option.file}`"
class="mb-4"
max-height="140"
contain
/>
<span>{{ option.name }}</span>
</div>
</template>
</v-checkbox>
</div>
</v-card-text>
<v-card-actions class="d-flex">