useTextareaAutosize ​
Automatically update the height of a textarea depending on the content.
Demo ​
Type, the textarea will grow:
Usage ​
vue
<script setup lang="ts">
const { textarea, input } = useTextareaAutosize()
</script>
<template>
<textarea
ref="textarea"
v-model="input"
class="resize-none"
placeholder="What's on your mind?"
/>
</template>
<script setup lang="ts">
const { textarea, input } = useTextareaAutosize()
</script>
<template>
<textarea
ref="textarea"
v-model="input"
class="resize-none"
placeholder="What's on your mind?"
/>
</template>
Source ​
Contributors ​
Changelog ​
v10.2.0
on 6/16/2023v10.0.0-beta.0
on 3/14/2023v9.7.0
on 12/16/2022ea497
- fix: referencev8.9.0
on 7/6/2022