mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-25 09:20:36 +01:00
feat(Form): Select and InputMenu integration (#97)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -75,13 +75,6 @@ const ui = computed(() => tv({ extend: checkbox, slots: props.ui })({
|
||||
checked: modelValue.value ?? props.defaultValue,
|
||||
indeterminate: indeterminate.value
|
||||
}))
|
||||
|
||||
// FIXME: I think there's a race condition between this and the v-model event.
|
||||
// This must be triggered after the value updates, otherwise the form validates
|
||||
// the previous value.
|
||||
function onChecked() {
|
||||
emitFormChange()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -95,7 +88,7 @@ function onChecked() {
|
||||
:name="name"
|
||||
:disabled="disabled"
|
||||
:class="ui.base()"
|
||||
@update:checked="onChecked"
|
||||
@update:checked="emitFormChange()"
|
||||
>
|
||||
<CheckboxIndicator as-child>
|
||||
<UIcon v-if="indeterminate" :name="indeterminateIcon || appConfig.ui.icons.minus" :class="ui.icon()" />
|
||||
|
||||
Reference in New Issue
Block a user