vue-textarea-autosize is a lightweight Vue.js component that provides a `<textarea>` element with automatically adjustable height based on its content. It supports standard `v-model` binding, allowing for two-way data synchronization, and includes props for setting `minHeight` and `maxHeight` to constrain the textarea's dimensions. The component differentiates itself by explicitly stating it has no external dependencies or wrappers, aiming for a simple and performant solution. Currently at version 1.1.1, the package appears to be primarily targeted at Vue 2 applications, as indicated by its documentation and a Vue 2 badge. With its last update approximately four years ago and Vue 2 having reached end-of-life, the project is likely in an abandoned state, meaning new feature development or compatibility updates for Vue 3 are not expected.
npm install vue-textarea-autosizeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to globally register and use the `textarea-autosize` component with `v-model`, `min-height`, `max-height`, and native event handling in a Vue 2 application. It also shows how to programmatically interact with the underlying `<textarea>` element using refs.
For Vue 3 projects, seek a dedicated autosizing textarea component built for Vue 3 or implement the functionality manually.
Always append `.native` to event listeners when you intend to capture events directly from the root DOM element of the component, e.g., `@event.native="handler"`.
Apply desired CSS styles directly to the `<textarea-autosize>` component, as it renders a plain `<textarea>` element.
Use the `important` prop sparingly and only when necessary to override conflicting styles. Prefer standard CSS specificity rules for styling when possible.
Ensure you have `import TextareaAutosize from 'vue-textarea-autosize'; Vue.use(TextareaAutosize);` in your main JavaScript file, or `components: { TextareaAutosize }` in your component options.Ensure the component with `ref="myTextarea"` is rendered and mounted. Access `$el` in lifecycle hooks like `mounted()` or after a `nextTick()` if its presence depends on conditional rendering.
Ensure you are using `v-model="yourDataProperty"` on the `<textarea-autosize>` component and that `yourDataProperty` is part of your component's `data` object and thus reactive.
No dependency data recorded yet.