Static GitHub Issues

[2620] Router :: param doesn't want to be optional

prev: how to use nuxt's loading component inside page?
next: [Question] Is there a way to dump all the routes(for debugging purposes)?

Desired Outcome

My goal is to have a topic/:slug? route, that would look like the following in a non-nuxt vue project:

<img width="675" alt="screen shot 2018-01-17 at 6 21 01 pm" src="https://user-images.githubusercontent.com/11467210/35047449-63b6ab4c-fbb3-11e7-9195-0d7a8bb16416.png">

e.g to have a slug as an optional parameter for the /topic route.

The Problem

My pages folder looks like this:

<img width="194" alt="screen shot 2018-01-24 at 8 55 31 pm" src="https://user-images.githubusercontent.com/11467210/35373096-86796fee-01b6-11e8-8382-e9871c9dca2f.png">

However, the result is /topic/:slug instead of /topic/:slug?:

<img width="427" alt="screen shot 2018-01-17 at 6 25 51 pm" src="https://user-images.githubusercontent.com/11467210/35047904-dd3cbd2a-fbb4-11e7-815e-f4affe4d324b.png">

What am I doing wrong? Is it a bug?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2279">#c2279</a>)</em></sub></div>