From the course: Learning Vue.js

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Configuring radio buttons and select elements

Configuring radio buttons and select elements - Vue.js Tutorial

From the course: Learning Vue.js

Start my 1-month free trial

Configuring radio buttons and select elements

- [Instructor] Now we'll find out how to bind data to radio buttons, and then we'll do the same for select elements, also known as drop-downs. So here we have a couple of related radio buttons in a field set for an additional option called leech action, with one of two values, tag or suspend. Leech is a term that I'm borrowing from a popular flashcard program called Anki, which gets his name from the Japanese word for memorization. Anki defines leeches as cards that you tend to have trouble with repeatedly. So you'll have the choice to either temporarily suspend them or just tag them as leeches for reference. Much like a group of related check boxes, I'll use the same V-model property on each radio button element. And we'll call it leech. So I'll add V-model equals leech, and then copy that to the next radio button. (computer keys clicking) And then in our data object down here, we'll add leech and we can let it default to…

Contents