v-autosize

1.0.3 • Public • Published

v-autosize

NPM Package Minified Size Build Status License: MIT

Lightweight Vue wrapper for autosize. Use v-autosize directive on the textarea element to make it automatically adjust height to fit text.

Install

npm install v-autosize

Usage

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>

Comparison

  • This module: 3.7 kB Minified, 1.3 kB Gzipped
  • vue-autosize: 5.2 kB Minified, 1.9 kB Gzipped
  • vue-textarea-autosize: 3.5 kB Minified, 1.4 kB Gzipped. A component is used instead of a directive.

License

MIT License

Package Sidebar

Install

npm i v-autosize

Weekly Downloads

890

Version

1.0.3

License

MIT

Unpacked Size

32.4 kB

Total Files

9

Last publish

Collaborators

  • shrpne