Lightweight Vue 3 wrapper for autosize.
Use v-autosize
directive on the textarea
element to make it automatically adjust height to fit text.
Check old version v-autosize@1
npm install v-autosize
Register directive locally in the component
import autosize from 'v-autosize';
// Your component
export default {
directives: {
autosize,
}
}
Or register directive globally in the root Vue instance
import Vue from 'vue';
import autosize from 'v-autosize/dist/plugin';
Vue.use(autosize);
Use v-autosize
directive on the textarea
element
<textarea v-autosize></textarea>
- This module:
-
vue-autosize
:autosize-input
included, not maintained. -
vue-textarea-autosize
: A component is used instead of a directive.
MIT License