Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 432da8c

Browse files
authored
Merge pull request #235 from Haeresis/routing
[Doc EN]: `guide/routing.md` review
2 parents f1daedc + 70bafd0 commit 432da8c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

en/guide/routing.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ router: {
8888

8989
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.
9090

91-
<p class="Alert Alert--info">Warning: dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)</p>
91+
<p class="Alert Alert--info"><b>Warning:</b> dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)</p>
9292

9393
### Validate Route Params
9494

@@ -115,7 +115,7 @@ Nuxt.js lets you create nested route by using the children routes of vue-router.
115115

116116
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.
117117

118-
<p class="Alert Alert--info">Don't forget to write `<nuxt-child/>` inside the parent component (.vue file).</p>
118+
<p class="Alert Alert--info"><b>Warning:</b> don't forget to write `<nuxt-child/>` inside the parent component (<code>.vue</code> file).</p>
119119

120120
This file tree:
121121

@@ -213,15 +213,16 @@ router: {
213213

214214
## Transitions
215215

216-
Nuxt.js uses the [&lt;transition&gt;](http://vuejs.org/v2/guide/transitions.html#Transitioning-Single-Elements-Components) component to let you create amazing transitions/animations between your routes.
216+
Nuxt.js uses the [`<transition>`](http://vuejs.org/v2/guide/transitions.html#Transitioning-Single-Elements-Components) component to let you create amazing transitions/animations between your routes.
217217

218218
### Global Settings
219219

220-
<p class="Alert Alert--info">Nuxt.js default transition name is `"page"`.</p>
220+
<p class="Alert Alert--nuxt-green"><b>Info :</b> Nuxt.js default transition name is `"page"`.</p>
221221

222222
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.
223223

224224
Our global css in `assets/main.css`:
225+
225226
```css
226227
.page-enter-active, .page-leave-active {
227228
transition: opacity .5s;
@@ -232,6 +233,7 @@ Our global css in `assets/main.css`:
232233
```
233234

234235
We add its path in our `nuxt.config.js` file:
236+
235237
```js
236238
module.exports = {
237239
css: [
@@ -247,6 +249,7 @@ More information about the transition key: [API Configuration transition](/api/p
247249
You can also define a custom transition for only one page with the `transition` property.
248250

249251
We add a new class in our global css in `assets/main.css`:
252+
250253
```css
251254
.test-enter-active, .test-leave-active {
252255
transition: opacity .5s;
@@ -257,6 +260,7 @@ We add a new class in our global css in `assets/main.css`:
257260
```
258261

259262
then, we use the transition property to define the class name to use for this page transition:
263+
260264
```js
261265
export default {
262266
transition: 'test'
@@ -280,13 +284,15 @@ export default function (context) {
280284
```
281285

282286
The middleware will be executed in series in this order:
287+
283288
1. `nuxt.config.js`
284289
2. Matched layouts
285290
3. Matched pages
286291

287292
A middleware can be asynchronous, simply return a `Promise` or use the 2nd `callback` argument:
288293

289294
`middleware/stats.js`
295+
290296
```js
291297
import axios from 'axios'
292298

@@ -300,6 +306,7 @@ export default function ({ route }) {
300306
Then, in your `nuxt.config.js`, layout or page, use the `middleware` key:
301307

302308
`nuxt.config.js`
309+
303310
```js
304311
module.exports = {
305312
router: {

0 commit comments

Comments
 (0)