Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions src/components/information/QuestionEditField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const requiredRule = (v: unknown) => (v === undefined || v === null ? '必須項
:rules="[requiredRule]"
:disabled="!question.isOpen"
variant="underlined"
:class="$style.wrapText"
></v-text-field>
<v-number-input
v-if="question.type === 'free_number'"
Expand All @@ -30,6 +31,7 @@ const requiredRule = (v: unknown) => (v === undefined || v === null ? '必須項
:disabled="!question.isOpen"
variant="underlined"
control-variant="hidden"
:class="$style.wrapText"
></v-number-input>
<v-select
v-if="question.type === 'single'"
Expand All @@ -42,7 +44,18 @@ const requiredRule = (v: unknown) => (v === undefined || v === null ? '必須項
:items="question.options"
:item-value="(option) => option.id"
:item-title="(option) => option.content"
></v-select>
:class="$style.wrapText"
>
<template #item="{ props, item }">
<v-list-item v-bind="props">
<template #title>
<span style="white-space: normal;">
{{ item.title }}
</span>
</template>
</v-list-item>
</template>
</v-select>
<v-select
v-if="question.type === 'multiple'"
v-model="(value as number[])"
Expand All @@ -55,5 +68,22 @@ const requiredRule = (v: unknown) => (v === undefined || v === null ? '必須項
:items="question.options"
:item-value="(option) => option.id"
:item-title="(option) => option.content"
></v-select>
:class="$style.wrapText"
>
<template #item="{ props, item }">
<v-list-item v-bind="props">
<template #title>
<span style="white-space: normal;">
{{ item.title }}
</span>
</template>
</v-list-item>
</template>
</v-select>
</template>

<style module>
.wrapText :global(.v-select__selection-text) {
white-space: normal !important;
}
</style>
4 changes: 2 additions & 2 deletions src/mocks/handlers/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export const questionsHandlers = [
},
{
id: 4,
title: 'スキーセット',
title: 'スキーセットを借りるか借りないかを教えてください',
type: 'single',
options: [
{ id: 7, content: '借りる' },
{ id: 7, content: '借りるかもしれないしかりないかもしれない、この文章は長いので折り返される。スキー好き' },
{ id: 8, content: '借りない' },
],
isPublic: false,
Expand Down