Nuxt Dynamic routes

up:: Nuxt In our file system, we can add url variables with by wrapping a folder in square brackets:

pages/date/[dateSlug]/post/[postSlug].vue

In [postSlug].vue:

<template>
	Date Slug: {{ $route.params.dateSlug }}
	Post Slug: {{ $route.params.postSlug }}
</template>

We can also mix and match:

course/chapter-[chapterSlug]/lesson-[lessonSlug].vue

// Or:
course/[chapterSlug]-[lessonSlug].vue

// But! In the above example you can't use `-` in either of the slug because of how the regex works

Or we create optional params:

course/[chapterSlug]/[[lessonSlug]].vue