User {{ $route.params.id }}
```
```js
import User from './User.vue'
// these are passed to `createRouter`
const routes = [{ path: '/user/:id', component: User }]
```
--------------------------------
### SSR history setup with createMemoryHistory
Source: https://router.vuejs.org/guide/migration/index.html
On SSR, manually pass the appropriate history: `createMemoryHistory()` on the server and `createWebHistory()` on the client. Then push the request URL and wait for `router.isReady()`.
```javascript
// router.js
let history = isServer ? createMemoryHistory() : createWebHistory()
let router = createRouter({ routes, history })
// somewhere in your server-entry.js
router.push(req.url) // request url
router.isReady().then(() => {
// resolve the request
})
```
--------------------------------
### Define routes with nested children for active link example
Source: https://router.vuejs.org/guide/essentials/active-links.html
Example route configuration with a parent route `/user/:username` and a child route `role/:roleId`. Used to illustrate how ancestor routes are considered active when params match.
```javascript
const routes = [
{
path: '/user/:username',
component: User,
children: [
{
path: 'role/:roleId',
component: Role,
},
],
},
]
```
--------------------------------
### Use named route in