chore: uniformize defineModel placement and emits

This commit is contained in:
Benjamin Canac
2024-04-27 22:16:41 +02:00
parent def5f7c10b
commit ce28e662d6
7 changed files with 21 additions and 22 deletions

View File

@@ -40,11 +40,11 @@ import { useId, useAppConfig, useFormField } from '#imports'
const props = defineProps<SwitchProps>()
defineSlots<SwitchSlots>()
const modelValue = defineModel<boolean | undefined>({ default: undefined })
const appConfig = useAppConfig()
const rootProps = useForwardProps(reactivePick(props, 'as', 'required', 'value'))
const modelValue = defineModel<boolean | undefined>({ default: undefined })
const { inputId: _inputId, emitFormChange, size, color, name, disabled } = useFormField<SwitchProps>(props)
const inputId = _inputId.value ?? useId()