I am writing a small wrapper for a <input> component.
I was following the documentation and this
tutorial.
However I am having issues with the two-way binding.
I expect my component to work with v-model. The binding seems to work fine for updating the value, but when I change the value itself the component doesn't update. I've also read about transparent wrappers, which seems to be my issue here.
Simple example:
<template id="numInput" :v-on="listeners">
<div>
<!-- note the div here, it works without, but that's not what I want -->
<input ref:inp type="number" :value="num" @input="updateSelf($event.target.value)" @blur="reset" :class="{rc: isNegative}" />
</div>
</template>
You can find the whole code example here.
The binding works one way (modifying the text input). But the input component doesn't get updated the other way (button klick in example)
Any help is welcome!