chore(Input/InputNumber/PinInput/Textarea): clean functions order

This commit is contained in:
Benjamin Canac
2025-04-01 12:05:57 +02:00
parent ce767c8429
commit 4d8179ba08
4 changed files with 44 additions and 50 deletions

View File

@@ -104,12 +104,6 @@ const ui = computed(() => input({
const inputRef = ref<HTMLInputElement | null>(null)
function autoFocus() {
if (props.autofocus) {
inputRef.value?.focus()
}
}
// Custom function to handle the v-model properties
function updateInput(value: string | null) {
if (modelModifiers.trim) {
@@ -155,15 +149,21 @@ function onBlur(event: FocusEvent) {
emits('blur', event)
}
defineExpose({
inputRef
})
function autoFocus() {
if (props.autofocus) {
inputRef.value?.focus()
}
}
onMounted(() => {
setTimeout(() => {
autoFocus()
}, props.autofocusDelay)
})
defineExpose({
inputRef
})
</script>
<template>