feat(Form): Select and InputMenu integration (#97)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2024-05-10 12:53:52 +02:00
committed by GitHub
parent 810d278ea7
commit 52cf471099
14 changed files with 82 additions and 89 deletions

View File

@@ -55,13 +55,6 @@ const ui = computed(() => tv({ extend: switchTv, slots: props.ui })({
loading: props.loading,
disabled: disabled.value || props.loading
}))
// 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.
async function onChecked() {
emitFormChange()
}
</script>
<template>
@@ -75,7 +68,7 @@ async function onChecked() {
:name="name"
:disabled="disabled || loading"
:class="ui.base()"
@update:checked="onChecked"
@update:checked="emitFormChange()"
>
<SwitchThumb :class="ui.thumb()">
<UIcon v-if="loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.icon({ checked: true, unchecked: true })" />