From the course: Building Vue and Node Apps with Authentication

Unlock the full course today

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

Using route parameter

Using route parameter

From the course: Building Vue and Node Apps with Authentication

Start my 1-month free trial

Using route parameter

- [Instructor] In this video we'll create a new component that allows us to view an individual message, and we'll be able to access that individual message by passing in the ID as a route parameter in the URL. We will also be able to access the individual message by clicking on it in our Messages list. So let's begin by creating a new component. I'll start by copying the NewMessage component and pasting it in to create a duplicate. Then let's rename that to simply Message. Now if this naming convention confuses you between Message and Message feel free to change it to whatever you like. Just be mindful of any future references to this component. Next I'll modify the title on line five, and I'll just change it to Message. And we won't need a form since we're not submitting anything. So I'll get rid of that between line seven and line 16, and instead I'll just display the message body. So let's save out our new component, and let's add a route for it. So I'll copy line 17 and paste it…

Contents