Using props for accessing URL parameters within components with Vue Router (video)
By Mike Street
In this video, I walk through how to utilise Vue props in components when using Vue router.
Using props with components is one of the first things you learn when building an application with Vue, however, when it comes to accessing URL information it is often suggested to use
this.$route.params. This tutorial shows how you can remain using props to access the URL parameters and, in doing so, making your code DRYer, cleaner and easier to understand.
This is my first venture into screencasts. I appreciate the audio is a bit quiet but any other feedback would be welcomed!
It has been pointed out to me that the embedding component at the end doesn't show "Alan" - which is what is passed into the prop. I am now aware of this and will publish a video on
props and why that doesn't work.