D
D
dicem2020-01-09 15:33:22
Vue.js
dicem, 2020-01-09 15:33:22

Why doesn't Vue render the object's value?

There is a component

...
<button class="persons-counter-m" @click.prevent="deliveryDecriment()"></button>
<span>{{ formModel.persons }}</span>
<button class="persons-counter-p" @click.prevent="formModel.persons++"></button>
...

...
  data() {
    return {
      cartConfig,
      formModel: {
        ...
        persons: 1
      },
   }
...

And now formModel.persons does not want to be rendered in any way and displays NaN on manipulations like incrementing and decrementing. Why does this happen?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question