In terms of vuejs:
How to add constraints(limits) to v-model
properly?
Let's say I want to allow only numbers between 0
and 5
.
<input type="number" v-model="model"/>
Perhaps I can watch
input's value. But it's a bit hacky, isn't it?
UPD: Other option is to handle onChange
, onKeyUp
and etc and other events: HTML Text Input allow only Numeric input