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

Following the previous homework exercise, you should try to expand it a bit. The user now types in his gender along with his name. If user is a male, then the heading will greet the user with "Hello Mister {{name}}". If user is a female, then "Hello Miss {{name}}" should appear instead.

When gender is neither male or female then the user should see the warning heading "So you can't decide. Fine!".

Tip

A logical operator would come handy to determine user title.

Homework

Example output

Note

The example output makes use of Bootstrap. If you are not familiar with Bootstrap you can ignore it for now, it is covered in Chapter 4, List Rendering.

You can find ...

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