Instructor: We'll start by adding a parameter to our URL navigation, in this case, ID. We'll go to the component and access that parameter directly in the template using this.$route.params.id. If we append our URL with a /1234, that acts as the ID and it appears in our view.
Our final option is to head to the route record and set props to true. Now, our param is set as a prop that gets passed into our component. We can set props so that ID is the keyword that we're accessing. Using the same template property, we can refresh.
We'll see 1234 appear as our ID on our page. These are three different ways to accomplish the same thing.
You must be a Pro Member to view code
Access all courses and lessons, track your progress, gain confidence and expertise.