Allow passthrough attrs on UrlInput (#2329)

This commit is contained in:
Chenlei Hu
2025-01-23 14:29:38 -05:00
committed by GitHub
parent 3f787e2dbf
commit 93dc50a95a
2 changed files with 38 additions and 2 deletions

View File

@@ -1,9 +1,9 @@
<template>
<IconField class="w-full">
<InputText
v-bind="$attrs"
:model-value="modelValue"
class="w-full"
:placeholder="placeholder"
:invalid="validationState === UrlValidationState.INVALID"
@update:model-value="handleInput"
@blur="validateUrl"
@@ -32,7 +32,6 @@ import { checkUrlReachable } from '@/utils/networkUtil'
const props = defineProps<{
modelValue: string
placeholder?: string
}>()
const emit = defineEmits<{
@@ -80,4 +79,9 @@ const validateUrl = async () => {
validationState.value = UrlValidationState.INVALID
}
}
// Add inheritAttrs option to prevent attrs from being applied to root element
defineOptions({
inheritAttrs: false
})
</script>