Skip to content

Commit

Permalink
fix : error TS2367: This comparison appears to be unintentional becau…
Browse files Browse the repository at this point in the history
…se the types 'string | number' and 'boolean' have no overlap.
  • Loading branch information
amandine-sahl committed Jul 7, 2023
1 parent ccfcdca commit 665c57e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions front-vite/src/components/ReservationField.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<template>
<span v-if="value">
<label class="block text-sm font-medium leading-6 text-gray-900">{{ field.label }} : </label>
<span v-if="field.type === 'boolean'">
{{ value === true ? 'oui' : ( value === false ? 'non' : 'pas de valeur' ) }}
<label class="block text-sm font-medium leading-6 text-gray-900">{{ field.label }} : </label>
<span v-if="field.type === 'boolean'">
{{ Boolean(value) === true ? 'oui' : (Boolean(value) === false ? 'non' : 'pas de valeur') }}
</span>
<span v-else-if="field.type === 'date'">
{{ formatDateTimeString(value as string) }}
</span>
<template v-else-if="field.type === 'paragraph'">
<p
v-for="comment in (value as string).split('\n')"
:key="comment"
>
{{ comment }}
</p>
</template>
<span v-else>
{{ value }}
</span>
</span>
<span v-else-if="field.type === 'date'">
{{ formatDateTimeString(value as string) }}
</span>
<template v-else-if="field.type === 'paragraph'">
<p
v-for="comment in (value as string).split('\n')"
:key="comment"
>
{{comment }}
</p>
</template>
<span v-else>
{{ value }}
</span>
</span>
</template>

<script setup lang="ts">
Expand Down

0 comments on commit 665c57e

Please sign in to comment.