* Toggles!

* Toggle component

* Ran prettier
This commit is contained in:
Adrian O.V
2023-03-24 15:15:55 -04:00
committed by GitHub
parent 4ae7786362
commit f97c94832a
4 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<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>