As of now, the slug is based on the filename inside the page. Of course, we can customize it dynamically:
https://nuxtjs.org/guide/routing/
Is there such a thing like these:
page/custom.vue
export default {
slug: 'my-custom-slug', //this is what I am thinking
}
page/another.vue
export default {
slug: 'another-changed-slug', //this way
}
According to docs:
There are multiple ways to extend the routing with Nuxt:
- router-extras-module to customize the route parameters in the page component
- @nuxtjs/router to overwrite the Nuxt router and write your own router.js file
- Use the router.extendRoutes property in your nuxt.config.js
I do suggest to use router-extras-module. Take a look to an example
Thank you. :D
馃憤 I close this issue, if you have any question feel free to ask
Most helpful comment
According to docs:
I do suggest to use router-extras-module. Take a look to an example