Vue converts input[type=number] to a string value

You need to use .number modifier for v-model, like this:

<input v-model.number="quantity" type="number">

Note: empty string ('') is not converted to a number, so you may need to handle it separately.

Leave a Comment