mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +00:00
add name on custom routes example
This commit is contained in:
parent
b0c308f1b1
commit
3536936856
@ -9,7 +9,7 @@ Add your custom routes inside `nuxt.config.js`:
|
||||
module.exports = {
|
||||
router: {
|
||||
routes: [
|
||||
{ path: '/users/:id', component: 'pages/user' }
|
||||
{ name: 'user', path: '/users/:id', component: 'pages/user' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ Let's say I have a component `pages/user.vue` and I don't want nuxt.js to create
|
||||
You can then change the component path in the `nuxt.config.js`:
|
||||
```js
|
||||
// ...
|
||||
{ path: '/users/:id', component: 'pages/_user' }
|
||||
{ name: 'user', path: '/users/:id', component: 'pages/_user' }
|
||||
// ...
|
||||
```
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
router: {
|
||||
routes: [
|
||||
{ path: '/users/:id(\\d+)', component: 'pages/_user' }
|
||||
{ name: 'user', path: '/users/:id(\\d+)', component: 'pages/_user' }
|
||||
]
|
||||
},
|
||||
build: {
|
||||
|
Loading…
Reference in New Issue
Block a user