Skip to content

Vue component provides textarea with automatically adjustable height and without any wrappers and dependencies

License

Notifications You must be signed in to change notification settings

88labs/vue-textarea-autosize

Repository files navigation

vue-textarea-autosize

npmnpmvue2

Vue component provides textarea with automatically adjustable height and without any wrappers and dependencies

Finctionality

  • v-model binding in parent
  • min/max height limitation
  • enable/disable auto resizing dynamically

Note

  • You are able to handle all native events via @eventname.nativeread more
  • There is no CSS from box, so you are free to style it as you wish

Install

Install with npm

npm install vue-textarea-autosize --save 

or with yarn

yarn add vue-textarea-autosize 

Adding into app

In your main.js

importVuefrom'vue'importVueTextareaAutosizefrom'vue-textarea-autosize'Vue.use(VueTextareaAutosize)

Usage

In components

<textarea-autosizeplaceholder="Type something here..." ref="someName" v-model="someValue" :min-height="30" :max-height="350" @blur.native="onBlurTextarea" ></textarea-autosize>

Focus/blur or select content in components

this.$refs.someName.$el.focus()this.$refs.someName.$el.blur()this.$refs.someName.$el.select()

Interface

Props

PropsRequiredTypeDefaultDescription
autosize falseBoolean trueallow to enable/disable auto resizing dynamically
minHeightfalseNumbernullmin textarea height
maxHeightfalseNumbernullmax textarea height

Events

NameParamsDescription
inputvaluefires on textarea content changed. part of a v-model binding. read more

Slots

There are no slots available


License

MIT

About

Vue component provides textarea with automatically adjustable height and without any wrappers and dependencies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript56.9%
  • Vue43.1%