0.2.0 • Published 3 years ago

vue-textarea-autogrow-directive v0.2.0

Weekly downloads
269
License
-
Repository
github
Last release
3 years ago

Vue Textarea Autogrow Directive

A vue directive for automatically growing and shrinking the height of textareas.

Features

  • Adjusts height as you type
  • Setting initial height when loaded
  • Adjust height on copy and paste
  • Adjust height when textarea's visibility is hidden (useful when a page is rendered whilst the textarea is hidden and later shown)

Project setup

npm install vue-textarea-autogrow-directive

Demo

Usage

Globally

Recommended option if using in more than a couple of components.

// main.js
import Vue from 'vue'
import VueTextareaAutogrowDirective from 'vue-textarea-autogrow-directive'

Vue.use(VueTextareaAutogrowDirective)

// MyComponent.vue
<template>
  <textarea v-autogrow></textarea>
</template>

In a component

Recommended if using only once or twice in your project.

<template>
  <textarea v-autogrow></textarea>
</template>

<script>
  import { TextareaAutogrowDirective } from 'vue-textarea-autogrow-directive'
  export default {
    name: 'MyComponent',
    directives: {
      'autogrow': TextareaAutogrowDirective
    } 
  }
</script>
0.1.10

3 years ago

0.2.0

3 years ago

0.1.7

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago