A simple Vue.js directive for autosizing a text input based on its content.
$ npm install vue-input-autosize --save
or include the UMD build, hosted by npmcdn in a
...and inside your template:
<input type='text' :value='msg' v-input-autosize />
Why bind to
value instead of using
Currently, there's no easy way to track changes to a
v-model value from a directive. However, since the
value property of a text field controls its content, and is also a valid parameter to watch for updates from the directive, we can dynamically bind to that instead.
MIT © Collin Henderson