Adrian O.V f97c94832a
Toggles (#24)
* Toggles!

* Toggle component

* Ran prettier
2023-03-24 12:15:55 -07:00

38 lines
564 B
Vue

<template>
<input
:id="id"
type="checkbox"
class="switch stylized-toggle"
:checked="checked"
@change="toggle"
/>
</template>
<script>
export default {
props: {
id: {
type: String,
required: true,
},
modelValue: {
type: Boolean,
},
checked: {
type: Boolean,
required: true,
},
},
emits: ['update:modelValue'],
methods: {
toggle() {
if (!this.disabled) {
this.$emit('update:modelValue', !this.modelValue)
}
},
},
}
</script>
<style scoped></style>