Skip to content

Instantly share code, notes, and snippets.

@thomaslombart
thomaslombart / Switch.vue
Created August 24, 2020 16:03
An example of a toggle switch with Vue 3
<template>
<label class="container">
<input
v-bind="$attrs"
class="input"
type="checkbox"
:checked="checked"
@change="$emit('update:checked', $event.target.checked)"
/>
<span class="switch"></span>