Check out a free preview of the full Building Applications with Vue & Nuxt course

The "Composition API Exercise" Lesson is part of the full, Building Applications with Vue & Nuxt course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to use the Composition API to display a list of items and create a method to display an alert when an item is clicked.

Preview
Close

Transcript from the "Composition API Exercise" Lesson

[00:00:00]
>> We have our final exercise, our composition API problem one. Create a page similar to the index page. So take that comp API, compapi-start, create a page with a list. And show it in the page and add that page to the menu. Also create a method to show a display and the clicked list item in an alert.

[00:00:26]
And I'll show you what I mean by that, because that sounds like a lot. So I've deployed this composition API demo. I have this increased count here just like we had before. And then I have our taco friends page. So in our taco friend's page, we have Sarah likes all the tacos, Brian Holt likes whiskey more than tacos.

[00:00:49]
Brian, Shirley Wu likes tacos as much as Wonder Woman. So you wanna click on one of these friends and have it execute something like this. Brian Holt likes whiskey more than tacos. So you wanna make a list. You can use ref, or you can use reactive, it's up to you.

[00:01:07]
But you wanna execute a function where if you click something, it's actually alerting that to the page.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now