You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: en/guide/routing.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ router: {
88
88
89
89
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.
90
90
91
-
<pclass="Alert Alert--info">Warning: dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)</p>
91
+
<pclass="Alert Alert--info"><b>Warning:</b> dynamic routes are ignored by the `generate` command: [API Configuration generate](/api/configuration-generate#routes)</p>
92
92
93
93
### Validate Route Params
94
94
@@ -115,7 +115,7 @@ Nuxt.js lets you create nested route by using the children routes of vue-router.
115
115
116
116
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.
117
117
118
-
<pclass="Alert Alert--info">Don't forget to write `<nuxt-child/>` inside the parent component (.vue file).</p>
118
+
<pclass="Alert Alert--info"><b>Warning:</b> don't forget to write `<nuxt-child/>` inside the parent component (<code>.vue</code> file).</p>
119
119
120
120
This file tree:
121
121
@@ -213,15 +213,16 @@ router: {
213
213
214
214
## Transitions
215
215
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.
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.
217
217
218
218
### Global Settings
219
219
220
-
<pclass="Alert Alert--info">Nuxt.js default transition name is `"page"`.</p>
220
+
<pclass="Alert Alert--nuxt-green"><b>Info :</b> Nuxt.js default transition name is `"page"`.</p>
221
221
222
222
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.
223
223
224
224
Our global css in `assets/main.css`:
225
+
225
226
```css
226
227
.page-enter-active, .page-leave-active {
227
228
transition: opacity .5s;
@@ -232,6 +233,7 @@ Our global css in `assets/main.css`:
232
233
```
233
234
234
235
We add its path in our `nuxt.config.js` file:
236
+
235
237
```js
236
238
module.exports= {
237
239
css: [
@@ -247,6 +249,7 @@ More information about the transition key: [API Configuration transition](/api/p
247
249
You can also define a custom transition for only one page with the `transition` property.
248
250
249
251
We add a new class in our global css in `assets/main.css`:
252
+
250
253
```css
251
254
.test-enter-active, .test-leave-active {
252
255
transition: opacity .5s;
@@ -257,6 +260,7 @@ We add a new class in our global css in `assets/main.css`:
257
260
```
258
261
259
262
then, we use the transition property to define the class name to use for this page transition:
263
+
260
264
```js
261
265
exportdefault {
262
266
transition:'test'
@@ -280,13 +284,15 @@ export default function (context) {
280
284
```
281
285
282
286
The middleware will be executed in series in this order:
287
+
283
288
1.`nuxt.config.js`
284
289
2. Matched layouts
285
290
3. Matched pages
286
291
287
292
A middleware can be asynchronous, simply return a `Promise` or use the 2nd `callback` argument:
0 commit comments