A
A
Andrey Brekotkin2019-09-05 09:11:20
Vue.js
Andrey Brekotkin, 2019-09-05 09:11:20

How to set checked input type="radio" before executing methods in Vue?

Good afternoon!
I’m sitting, stupid, I can’t solve a standard (seemingly) task:
There are several input type = "radio" when you click, you need to:
1. Set the standard checked - select this item
2. and go to the next form
I set it like this:

<input type="radio" value="1" v-model="question.num1"  @click="toggleQuestion()">
<input type="radio" value="2" v-model="question.num1"  @click="toggleQuestion()">

...
  methods: {
    toggleQuestion(num) {
Переход к форме
                }
            }
  }
...

Only in this case, the transition is immediately performed, the input does not change the value, does not become checked
How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2019-09-05
@brekot

What if you use @change instead of @click ? )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question