A
A
asferot2019-04-03 11:53:10
Vue.js
asferot, 2019-04-03 11:53:10

How to track selection?

How to track the selection of a position? If the click was on the first radiobutton, then put it on input - disabled on the second line. If the click fell on the second radio button - then hang it on the input - disabled on the first line?

<div class="choice">
            <input type="radio" value="Рестораны/кафе" id="restaurant" v-model="position">
            <label for="restaurant">Рестораны/кафе</label>
            <input type="text" v-model="choice_numb_1">
        </div>
        <div class="choice_2">
            <input type="radio" value="Фастфуд" id="fastfood" v-model="position">
            <label for="fastfood">Фастфуд</label>
            <input type="text" v-model="choice_numb_2">
        </div>

5ca4746c4b6f0308602250.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2019-04-03
@asferot

<input type="text" v-model="choice_numb_1" :disabled="position !== 'Рестораны/кафе'">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question