@@ -70,15 +66,15 @@ const ariaLabelledby = computed(() => message.value ? `${props.titleId} messages
v-for="option in options"
:id="option.id"
:key="option.id || option.name"
+ v-model="modelValue"
+ :value="option.value"
:name="option.name"
:label="option.label"
:disabled="option.disabled"
:aria-disabled="option.disabled"
:small="small"
:inline="inline"
- :model-value="modelValue.includes(option.name)"
:hint="option.hint"
- @update:model-value="onChange({ name: option.name, checked: $event })"
/>
@@ -21,6 +22,7 @@ const validMessage = 'Message de validation'
Object.fromEntries(
- Object.entries(option).map(([key, value]) => [key, value.replace('name1', 'name2')]),
+ Object.entries(option).map(([key, value]) => [key, ['id', 'name'].includes(key) ? value.replace('name1', 'name2') : value]),
))
const options3 = structuredClone(options1).map(option => Object.fromEntries(
- Object.entries(option).map(([key, value]) => [key, value.replace('name1', 'name3')]),
+ Object.entries(option).map(([key, value]) => [key, ['id', 'name'].includes(key) ? value.replace('name1', 'name3') : value]),
))
const options4 = structuredClone(options1).map(option => Object.fromEntries(
- Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, value.replace('name1', 'name4')]),
+ Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, ['id', 'name'].includes(key) ? value.replace('name1', 'name4') : value]),
))
const options5 = structuredClone(options1).map(option => Object.fromEntries(
- Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, value.replace('name1', 'name5')]),
+ Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, ['id', 'name'].includes(key) ? value.replace('name1', 'name5') : value]),
))
const options6 = structuredClone(options1).map(option => Object.fromEntries(
- Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, value.replace('name1', 'name6')]),
+ Object.entries(option).filter(([key]) => key !== 'hint').map(([key, value]) => [key, ['id', 'name'].includes(key) ? value.replace('name1', 'name6') : value]),
))
const errorMessage = 'Message d’erreur'