Unfortunately, you cannot do this, but you can deceive and approach.
mounted() {
var self = this;
Object.keys(Event.prototype).forEach(function(ev) {
self.$refs.text.addEventListener(ev.toLowerCase(), function(d) {
self.$emit(ev.toLowerCase(), d);
console.log("emitting", ev, d);
})
})
}
With this you get access to mousedown, mouseup, mouseover, mouseout, mousemove, mousedrag, click, dblclick, keydown, keyup, keypress, dragdrop, focus, blur, selectand change. Then in the parent template ...
<my-textarea @keyup="update()" @change="somethingElse()"></my-textarea>
Here's the fiddle https://jsfiddle.net/rdjjpc7a/371/
source
share