fix(components): hydration attribute mismatch with vue 3.4 (#1199)

This commit is contained in:
Benjamin Canac
2024-02-06 12:42:19 +01:00
committed by GitHub
parent 4a5f7b06cf
commit 10db14475f
19 changed files with 227 additions and 253 deletions

View File

@@ -98,7 +98,8 @@ import {
ComboboxButton as HComboboxButton,
ComboboxOptions as HComboboxOptions,
ComboboxOption as HComboboxOption,
ComboboxInput as HComboboxInput
ComboboxInput as HComboboxInput,
provideUseId
} from '@headlessui/vue'
import { computedAsync, useDebounceFn } from '@vueuse/core'
import { defu } from 'defu'
@@ -114,6 +115,7 @@ import type { InputSize, InputColor, InputVariant, PopperOptions, Strategy } fro
// @ts-expect-error
import appConfig from '#build/app.config'
import { input, inputMenu } from '#ui/ui.config'
import { useId } from '#imports'
const config = mergeConfig<typeof input>(appConfig.ui.strategy, appConfig.ui.input, input)
@@ -275,7 +277,6 @@ export default defineComponent({
emits: ['update:modelValue', 'update:query', 'open', 'close', 'change'],
setup (props, { emit, slots }) {
const { ui, attrs } = useUI('input', toRef(props, 'ui'), config, toRef(props, 'class'))
const { ui: uiMenu } = useUI('inputMenu', toRef(props, 'uiMenu'), configMenu)
const popper = computed<PopperOptions>(() => defu({}, props.popper, uiMenu.value.popper as PopperOptions))
@@ -428,6 +429,8 @@ export default defineComponent({
query.value = event.target.value
}
provideUseId(() => useId())
return {
// eslint-disable-next-line vue/no-dupe-keys
ui,