From the course: Learning Vue.js
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Binding CSS classes
- [Instructor] In this video, we'll continue looking at managing dynamic CSS with Vue, this time through the use of class attribute bindings. And you can see that we're back to our flashcard presenter again. What a good flashcard app needs is a way to receive feedback from the user. At the very least, the user should be able to say either I'm good with this card for now or show me this one again in a bit. So let's add a couple of buttons for that. We're going to end up putting them right on the back of the card and one will say GOT IT and the other will say AGAIN. And we'll put them in a div with class score just to help with the layout a little bit. I'm also going to take this v-else here from the div with the back content and create a parent element for both of these elements so that they're toggled at the same time. The back content, along with those buttons for the feedback. One problem with our implementation…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.