mirror of
https://github.com/fmhy/edit.git
synced 2025-11-27 16:31:09 +11:00
Refactor Switch component to use model binding
This commit is contained in:
parent
dab0557c99
commit
7f09a9d148
1 changed files with 2 additions and 2 deletions
|
|
@ -2,11 +2,11 @@
|
|||
import { Switch } from '@headlessui/vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const enabled = defineModel({ default: false })
|
||||
const model = defineModel()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Switch v-model="enabled" class="switch" :class="{ enabled }">
|
||||
<Switch v-model="model" class="switch" :class="{ enabled: model }">
|
||||
<span class="thumb" />
|
||||
</Switch>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue