mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-05 14:48:03 +01:00
feat(Input/Textarea): expose ref
This commit is contained in:
@@ -24,7 +24,7 @@ links:
|
|||||||
|
|
||||||
:component-events
|
:component-events
|
||||||
|
|
||||||
### Exposed
|
### Expose
|
||||||
|
|
||||||
When accessing the component via a template ref, you can use the following:
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,14 @@ props:
|
|||||||
|
|
||||||
:component-events
|
:component-events
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `inputRef`{lang="ts-type"} | `Ref<HTMLInputElement \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -144,6 +144,14 @@ props:
|
|||||||
|
|
||||||
:component-events
|
:component-events
|
||||||
|
|
||||||
|
### Expose
|
||||||
|
|
||||||
|
When accessing the component via a template ref, you can use the following:
|
||||||
|
|
||||||
|
| Name | Type |
|
||||||
|
| ---- | ---- |
|
||||||
|
| `textareaRef`{lang="ts-type"} | `Ref<HTMLTextAreaElement \| null>`{lang="ts-type"} |
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
:component-theme
|
:component-theme
|
||||||
|
|||||||
@@ -133,6 +133,10 @@ function onBlur(event: FocusEvent) {
|
|||||||
emits('blur', event)
|
emits('blur', event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
inputRef
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
autoFocus()
|
autoFocus()
|
||||||
|
|||||||
@@ -228,6 +228,10 @@ function onUpdateOpen(value: boolean) {
|
|||||||
emits('focus', event)
|
emits('focus', event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
inputRef
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ watch(() => modelValue, () => {
|
|||||||
nextTick(autoResize)
|
nextTick(autoResize)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
textareaRef
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
autoResize()
|
autoResize()
|
||||||
|
|||||||
Reference in New Issue
Block a user