vue-transforming-textarea
v0.1.0
Published
Vuejs directive that resizes on an event (e.g. textarea)
Downloads
3
Readme
vue-resize-on-event
VueJS directive to resize a component when a given event fires.
Installation
npm install --save vue-resize-on-event
Example
Include the module for the input
event to register the custom directive v-resize-on-input
:
import Vue from 'vue'
import VueResizeOnEvent from 'vue-resize-on-event'
export default {
mixins: [
VueResizeOnEvent( 'input' ), //registers directive v-resize-on-input
],
data() {
return {
text: '',
}
},
}
Usage
Add attribute v-resize-on-input
to a textarea
element to have it resize automatically when its value is changed interactively.
<template>
<div>
<textarea
v-model="text"
v-resize-on-input>
</textarea>
</div>
</template>