Home

Issue: 208

How to add an alias for a route?

[issue link]

I tried to follow the docs and add a custom route, but looks like it’s in conflict with the nuxt-created route. What would be the correct way to get a route with an optional parametre?

router: {
	extendRoutes(routes) {
		routes.push({
			name: 'post',
			path: '/posts/:id',
			alias: '/posts/:id/:slug?',
			component: '~pages/posts/_id.vue'
		})
	}
}
This question is available on Nuxt.js community (#c178)