Skip to content

Commit

Permalink
chore(lib): update RadioButton
Browse files Browse the repository at this point in the history
- `RadioButton` migrates to Vue 3. Changes sufficient to render the
  documentation page of `Radio` (including `RadioButton`) are made.
- In `src/components/radio/RadioButton.vue`,
    - `disabled` and `required` are replaced with computed values
      `disabledOrUndefined` and `requiredOrUndefined` respectively,
      that take `true` or `undefined`. Because setting a boolean
      attribute does not remove it on Vue 3, but `null` or `undefined`
      has to be given to remove it.
    - Automatic ESLint fix is applied.
  • Loading branch information
kikuomax committed Jul 7, 2023
1 parent f8179db commit f1c2f84
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/radio/RadioButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
class="b-radio radio button"
ref="label"
:class="labelClass"
:disabled="disabled"
:disabled="disabledOrUndefined"
@click="focus"
@keydown.prevent.enter="$refs.label.click()">
<slot/>
@keydown.prevent.enter="$refs.label.click()"
>
<slot />
<input
v-model="computedValue"
type="radio"
ref="input"
@click.stop
:disabled="disabled"
:required="required"
:disabled="disabledOrUndefined"
:required="requiredOrUndefined"
:name="name"
:value="nativeValue"
@focus="isFocused = true"
@blur="isFocused = false">
@blur="isFocused = false"
>
</label>
</div>
</template>
Expand Down

0 comments on commit f1c2f84

Please sign in to comment.