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 = {
|
module.exports = {
|
||||||
router: {
|
router: {
|
||||||
routes: [
|
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`:
|
You can then change the component path in the `nuxt.config.js`:
|
||||||
```js
|
```js
|
||||||
// ...
|
// ...
|
||||||
{ path: '/users/:id', component: 'pages/_user' }
|
{ name: 'user', path: '/users/:id', component: 'pages/_user' }
|
||||||
// ...
|
// ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
router: {
|
router: {
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/users/:id(\\d+)', component: 'pages/_user' }
|
{ name: 'user', path: '/users/:id(\\d+)', component: 'pages/_user' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
Loading…
Reference in New Issue
Block a user