mirror of
https://github.com/fmhy/edit.git
synced 2025-11-28 08:51:08 +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 { Switch } from '@headlessui/vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const enabled = defineModel({ default: false })
|
const model = defineModel()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Switch v-model="enabled" class="switch" :class="{ enabled }">
|
<Switch v-model="model" class="switch" :class="{ enabled: model }">
|
||||||
<span class="thumb" />
|
<span class="thumb" />
|
||||||
</Switch>
|
</Switch>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue