Skip to content

Commit

Permalink
fix(toggle): fix typeof isActive
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaubree committed Dec 19, 2023
1 parent d56acac commit 5a8b0d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/toggle/UToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ watch(isActive, () => {
</script>

<template>
<Switch v-if="isActive" v-model="isActive" :disabled="isDisabled" :name="name" :aria-label="name" :class="config.wrapper">
<Switch v-if="typeof isActive === 'boolean'" v-model="isActive" :disabled="isDisabled" :name="name" :aria-label="name" :class="config.wrapper">
<span v-if="label" :class="[config.label.base, config.label.size[size]]">{{ label }}</span>
<div :class="[isActive ? config.button.active : config.button.inactive, config.button.size[size], config.button.base, { [config.button.disabled]: isDisabled }]">
<span :class="[isActive ? [config.slider.active, config.slider.translate[size]] : config.slider.inactive, config.slider.base, config.slider.size[size]]">
Expand Down

0 comments on commit 5a8b0d2

Please sign in to comment.