diff --git a/en/guide/routing.md b/en/guide/routing.md index e4051e47d..e7bf02589 100644 --- a/en/guide/routing.md +++ b/en/guide/routing.md @@ -88,7 +88,7 @@ router: { As you can see the route named `users-id` has the path `:id?` which makes it optional, if you want to make it required, create an `index.vue` file in the `users/_id` directory. -
Warning: dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)
+Warning: dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)
### Validate Route Params @@ -115,7 +115,7 @@ Nuxt.js lets you create nested route by using the children routes of vue-router. To define the parent component of a nested route, you need to create a Vue file with the **same name as the directory** which contain your children views. -Don't forget to write `
Warning: don't forget to write `.vue
file).
Nuxt.js default transition name is `"page"`.
+Info : Nuxt.js default transition name is `"page"`.
To add a fade transition to every page of your application, we need a CSS file that is shared across all our routes, so we start by creating a file in the `assets` folder. Our global css in `assets/main.css`: + ```css .page-enter-active, .page-leave-active { transition: opacity .5s; @@ -232,6 +233,7 @@ Our global css in `assets/main.css`: ``` We add its path in our `nuxt.config.js` file: + ```js module.exports = { css: [ @@ -247,6 +249,7 @@ More information about the transition key: [API Configuration transition](/api/p You can also define a custom transition for only one page with the `transition` property. We add a new class in our global css in `assets/main.css`: + ```css .test-enter-active, .test-leave-active { transition: opacity .5s; @@ -257,6 +260,7 @@ We add a new class in our global css in `assets/main.css`: ``` then, we use the transition property to define the class name to use for this page transition: + ```js export default { transition: 'test' @@ -280,6 +284,7 @@ export default function (context) { ``` The middleware will be executed in series in this order: + 1. `nuxt.config.js` 2. Matched layouts 3. Matched pages @@ -287,6 +292,7 @@ The middleware will be executed in series in this order: A middleware can be asynchronous, simply return a `Promise` or use the 2nd `callback` argument: `middleware/stats.js` + ```js import axios from 'axios' @@ -300,6 +306,7 @@ export default function ({ route }) { Then, in your `nuxt.config.js`, layout or page, use the `middleware` key: `nuxt.config.js` + ```js module.exports = { router: {