Skip to content

Commit

Permalink
Add index to label for
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinbusso committed Jun 7, 2024
1 parent d87a555 commit e6cdefa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/FormSelectList/OptionboxView.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<form>
<div :class="divClass" :key="getOptionValue(option)" v-for="option in options">
<div :class="divClass" :key="getOptionValue(option)" v-for="(option, index) in options">
<input
:class="inputClass"
type="radio"
v-uni-id="getOptionId(option)"
v-uni-id="getOptionId(option, index)"
:name="`${name}`"
:value="emitObjects ? option : getOptionValue(option)"
v-model="selected"
v-bind="$attrs"
:disabled="isReadOnly"
>
<label :class="labelClass" v-uni-for="getOptionId(option)">
<label :class="labelClass" v-uni-for="getOptionId(option, index)">
{{getOptionContent(option)}}
</label>
</div>
Expand Down Expand Up @@ -77,8 +77,8 @@ export default {
getOptionContent(option) {
return option[this.optionContent || 'content'];
},
getOptionId(option) {
return `${this.name}-${this.getOptionValue(option)}`;
getOptionId(option, index) {
return `${this.name}-${this.getOptionValue(option)}-${index}`;
}
}
}
Expand Down

0 comments on commit e6cdefa

Please sign in to comment.