Skip to content

Commit b239943

Browse files
Fixed a bug where v-model wouldn't update anymore
See vuejs/vue#7042.
1 parent d1e9fca commit b239943

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/BaseSwitch.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
<input type="checkbox"
44
v-model="model"
55
v-bind="$attrs"
6-
v-on="$listeners">
6+
v-on="{
7+
...$listeners,
8+
input: event => $emit('input', event.target.value === 'on' ? true : false)
9+
}"
10+
>
711
<span class="custom-toggle-slider rounded-circle"></span>
812
</label>
913
</template>

0 commit comments

Comments
 (0)