Nuxt/docs/content/2.app/2.pages.md
Daniel Roe e2f5a3c9b0
docs: app (#186)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2021-06-08 23:44:30 +02:00

701 B

Pages

Nuxt will automatically integrate Vue Router 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 parameter. You can mix and match multiple parameters and even non-dynamic text within a file name or directory.

Example

-| pages/
---| index.vue
---| users-[group]/
-----| [userid].vue

Given the example above, you can access group/userid within your component via the $route object:

<template>
  {{ $route.params.group }}
  {{ $route.params.id }}
</template>