Is it possible to achieve the following using (Pug
& CoffeeScript
):
input(placeholder="0", v-model.number="order[index]" v-on:change="adjustInput")
...
adjustInput: ->
event.target.style.width = event.target.value.length + 'ch'
Even though this code works when manually changing the input in the browser, it doesn't update the width if the change is made through v-model
. How can I ensure that the input width adjusts even when the change is due to Vue
reactivity?