Using props for accessing URL parameters within components with Vue Router (video)

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!

Update: 25/10/17

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.

You might also enjoy

  • Useful command line MySQL commands

    Posted on 5th July 2020.

    It seems I have been doing a lot of command line work on Debian with MySQL recently and have been having to search the internet (or my bash history) every time I need to do something. Here is a collection of commands I have been using…

  • The Git Commit Hash

    Posted on 28th May 2020.

    The magic 40 character string that is attached to every commit you do. What is it, where does it come from and will understanding it help you with Git in the future?…

  • Why should you consider Cloudflare for your website?

    Posted on 20th April 2020. Written For Liquid Light

    Cloudflare is a service which, among other things, provides a CDN (Content Delivery Network), firewall, and performance layer for your website. It has plenty of paid upgrades and features and is a developer’s dream, but what advantage does it have for you to put your website “behind” Cloudflare and how…

    Web
Mike Street

Written by Mike Street

Mike is a front-end developer from Brighton, UK. He spends his time writing, cycling and coding. You can find Mike on Twitter.