Vue component v-model with input handler
问题 I'm trying to make a wrapper component for an <input/> element in Vue.js. Component: <template> <div> <input v-bind="$attrs" :value="value" @input="input" /> ... </div> <template> Vue.component("my-input", { inheritAttrs: false, props: ['value'], methods: { input($event): void { this.$emit("input", $event.target.value) } } }) Usage: <my-input v-model="myModel" /> This seems to work just fine. The model gets updated via the input event handler by emitting the target element value. However, now