O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Homework

This is the most difficult exercise so far, so make sure to put in use everything you have learned in this book. Create an array of 4 horse-drawn chariots. Each chariot has a "name" and a number of "horses" (from 1 to 4). Create a Component named chariot. The chariot Component should display the name of the chariot and the number of the horses it has. It also must have an action button. The button's text depends on the currently selected chariot.

More specifically, button's text should be:

  • Pick Chariot: Before the user has chosen any chariot
  • Dismiss Horses: When the chariot has less horses than the selected chariot
  • Hire Horses: When the chariot has more horses than the selected chariot
  • Riding!: When the chariot is the selected chariot (this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required