47 lines
1.1 KiB
Vue
47 lines
1.1 KiB
Vue
<template>
|
|
<div class="emphased">
|
|
<div v-for="(val, index) in values" :id="`${questionId}-${val}`" :key="index"
|
|
:style="{ background: colors[index] }">
|
|
<input type="radio" :value="val" :name="String(questionId)">
|
|
<label :for="`${questionId}-${val}`">{{ val }}</label>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
interface Props {
|
|
values?: string[]
|
|
colors?: string[]
|
|
questionId: string
|
|
}
|
|
|
|
const { values = ["Très bien", "Bien", "Passable", "Insuffisant", "À rejeter"], colors = ["#4DB544", "#87E169", "#FFC33C", "#FF824B", "#E94A4D"], questionId } = defineProps<Props>()
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped="true" lang="css">
|
|
.emphased {
|
|
position: relative;
|
|
margin-top: 2em;
|
|
margin-bottom: 2em;
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
display: inline-flex;
|
|
flex-wrap: nowrap;
|
|
}
|
|
|
|
.emphased div {
|
|
padding: 3px;
|
|
border: 1px solid #444;
|
|
border-right: none;
|
|
text-overflow: ellipsis;
|
|
flex: 1 1 0;
|
|
width: 0;
|
|
}
|
|
|
|
.emphased div:last-child {
|
|
border-right: 1px solid #444;
|
|
}
|
|
</style> |