mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
e2f5a3c9b0
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
24 lines
701 B
Markdown
24 lines
701 B
Markdown
# Pages
|
|
|
|
Nuxt will automatically integrate [Vue Router](https://next.router.vuejs.org/) and map `pages/` directory into the routes of your application.
|
|
|
|
If you place anything within square brackets, it will be turned into a [dynamic route](https://next.router.vuejs.org/guide/essentials/dynamic-matching.html) parameter. You can mix and match multiple parameters and even non-dynamic text within a file name or directory.
|
|
|
|
## Example
|
|
|
|
```bash
|
|
-| pages/
|
|
---| index.vue
|
|
---| users-[group]/
|
|
-----| [userid].vue
|
|
```
|
|
|
|
Given the example above, you can access group/userid within your component via the `$route` object:
|
|
|
|
```vue
|
|
<template>
|
|
{{ $route.params.group }}
|
|
{{ $route.params.id }}
|
|
</template>
|
|
```
|