Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add custom paths notice #2963

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/content/docs/2.guide/3.custom-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export default defineNuxtConfig({
If you want customize the URL of a static vue file, you should use the file's name.
If the view is in a sub-directory you should use folder name and vue files name with trailing slash.

::callout{type="warning"}
All the URL should start with `/`
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
All URLs must start with `/`
::

#### Example 2: Localize the part of URL
Expand Down Expand Up @@ -186,6 +186,12 @@ export default defineNuxtConfig({

### Page component

::callout{icon="i-heroicons-exclamation-triangle" color="amber" title="notice"}
Note for those updating to `v8.0.1` or higher
:br :br
Path parameters parsing has been changed to match that of [Nuxt 3](https://nuxt.com/docs/guide/directory-structure/pages#dynamic-routes), you will have to update your custom paths (e.g. `/example/:param` should now be `/example/[param]`)
::

You can use the `defineI18nRoute` compiler macro to set some custom paths for each page component.

```html {}[pages/about.vue]
Expand Down