Skip to content

Commit

Permalink
refactor(checkbox|switch): change indexOf to includes (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Feb 28, 2024
1 parent 00a2055 commit c813ca0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/oruga/src/components/checkbox/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const isChecked = computed(
() =>
vmodel.value === props.trueValue ||
(Array.isArray(vmodel.value) &&
vmodel.value.indexOf(props.nativeValue) !== -1),
vmodel.value.includes(props.nativeValue)),
);
function onInput(event: Event): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/oruga/src/components/switch/Switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const isChecked = computed(
() =>
vmodel.value === props.trueValue ||
(Array.isArray(vmodel.value) &&
vmodel.value.indexOf(props.nativeValue) !== -1),
vmodel.value.includes(props.nativeValue)),
);
function onInput(event: Event): void {
Expand Down

0 comments on commit c813ca0

Please sign in to comment.