B
B
Bogdan2018-02-09 16:21:55
Vue.js
Bogdan, 2018-02-09 16:21:55

How about v-model in input type="number"?

Hello. I have an element in my template

export default {
  data() {
    return {
      listCount: 5,
    }
  },

<input type="number" v-model="listCount" min="1" max="15">

But when changing the value through input from a numeric value, does the variable change its type to a character one?
5a7da047f1f1a795294828.png
How to correct it? Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-02-09
@bogdan_uman

v-model.number="listCount"
https://ru.vuejs.org/v2/guide/forms.html#number

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question