0.1.4 • Published 3 years ago

vue-autoheight-input v0.1.4

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

Vue-Autoheight-Input

A simple vuejs plugin for auto resizing the height of a textarea

Installation

npm

  npm install vue-autoheight-input

yarn

  yarn add vue-autoheight-input

Usage

The wrapper creates a textarea feild on which all actions are implemented

<template>
    <autoheight-input v-model="content" @input="handleInput"></autoheight-input>
</template>
<script>
import {AutoheightInput} from 'vue-autoheight-input'
export default{
    components:{
        AutoheightInput
    },
    data(){
        return{
            content:''
        }
    },
    methods:{
        handleInput(evt){
            //
        }
    }
}
</script>

Custom styling

All custom styling can be adding via class aributes

Props

PropertyTypeRequiredDescriptionDefault
placeholderStringfalsethe editor placeholdertype here
maxlengthIntegerfalsethe max lenght of the inputnull
minlengthIntegerfalsethe min lenght of the inputnull
newLineBooleanfalsedetermines if enter key should trigger a new linetrue