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

Commit 1b36c40

Browse files
JunSébastien Chopin
Jun
authored and
Sébastien Chopin
committed
Add/fix information on nuxtChildKey (#1331)
* Fix extra space in package.json * all: Add additional information for nuxtChildKey Please refer to the following pull request in nuxt.js. nuxt/nuxt#5516
1 parent d8f08fa commit 1b36c40

File tree

8 files changed

+183
-22
lines changed

8 files changed

+183
-22
lines changed

de/api/components-nuxt.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ description: Display the page components inside a layout.
77

88
> This component is used only in [layouts](/guide/views#layouts) to display the page components.
99
10-
**Props**:
11-
- nuxtChildKey: `string`
12-
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
13-
- Default: `$route.fullPath`
14-
1510
Example (`layouts/default.vue`):
1611

1712
```html
@@ -25,3 +20,41 @@ Example (`layouts/default.vue`):
2520
```
2621

2722
To see an example, take a look at the [layouts example](/examples/layouts).
23+
24+
**Props**:
25+
26+
- nuxtChildKey: `string`
27+
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
28+
- Default: `$route.path`
29+
30+
There are 3 ways to handle internal `key` prop of `<router-view/>`.
31+
32+
1. `nuxtChildKey` prop
33+
34+
```html
35+
<template>
36+
<div>
37+
<nuxt :nuxt-child-key="someKey"/>
38+
</div>
39+
</template>
40+
```
41+
42+
2. `key` option in page components: `string` or `function`
43+
44+
```js
45+
export default {
46+
key(route) {
47+
return route.fullPath
48+
}
49+
}
50+
```
51+
52+
3. `watchQuery` option in page components: `boolean` or `string[]`
53+
54+
Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.
55+
56+
- name: `string` (_introduced with Nuxt v2.4.0_)
57+
- This prop will be set to `<router-view/>`, used to render named-view of page component.
58+
- Default: `default`
59+
60+
To see an example, take a look at the [named-views example](/examples/named-views).

en/api/components-nuxt.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ description: Display the page components inside a layout.
77

88
> This component is used only in [layouts](/guide/views#layouts) to display the page components.
99
10-
**Props**:
11-
12-
- nuxtChildKey: `string`
13-
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
14-
- Default: `$route.fullPath`
15-
1610
Example (`layouts/default.vue`):
1711

1812
```html
@@ -27,6 +21,38 @@ Example (`layouts/default.vue`):
2721

2822
To see an example, take a look at the [layouts example](/examples/layouts).
2923

24+
**Props**:
25+
26+
- nuxtChildKey: `string`
27+
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
28+
- Default: `$route.path`
29+
30+
There are 3 ways to handle internal `key` prop of `<router-view/>`.
31+
32+
1. `nuxtChildKey` prop
33+
34+
```html
35+
<template>
36+
<div>
37+
<nuxt :nuxt-child-key="someKey"/>
38+
</div>
39+
</template>
40+
```
41+
42+
2. `key` option in page components: `string` or `function`
43+
44+
```js
45+
export default {
46+
key(route) {
47+
return route.fullPath
48+
}
49+
}
50+
```
51+
52+
3. `watchQuery` option in page components: `boolean` or `string[]`
53+
54+
Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.
55+
3056
- name: `string` (_introduced with Nuxt v2.4.0_)
3157
- This prop will be set to `<router-view/>`, used to render named-view of page component.
3258
- Default: `default`

es/api/components-nuxt.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,41 @@ Example (`layouts/default.vue`):
2020
```
2121

2222
To see an example, take a look at the [layouts example](/examples/layouts).
23+
24+
**Props**:
25+
26+
- nuxtChildKey: `string`
27+
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
28+
- Default: `$route.path`
29+
30+
There are 3 ways to handle internal `key` prop of `<router-view/>`.
31+
32+
1. `nuxtChildKey` prop
33+
34+
```html
35+
<template>
36+
<div>
37+
<nuxt :nuxt-child-key="someKey"/>
38+
</div>
39+
</template>
40+
```
41+
42+
2. `key` option in page components: `string` or `function`
43+
44+
```js
45+
export default {
46+
key(route) {
47+
return route.fullPath
48+
}
49+
}
50+
```
51+
52+
3. `watchQuery` option in page components: `boolean` or `string[]`
53+
54+
Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.
55+
56+
- name: `string` (_introduced with Nuxt v2.4.0_)
57+
- This prop will be set to `<router-view/>`, used to render named-view of page component.
58+
- Default: `default`
59+
60+
To see an example, take a look at the [named-views example](/examples/named-views).

fr/api/components-nuxt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Affiche un composant de page à l'intérieur d'une mise en page.
1010
**Props** :
1111
- nuxtChildKey : `string`
1212
- Cette prop va être appliquée à `<router-view/>`. Utile pour faire des transitions à l'intérieur d'une page dynamique et d'une route différente.
13-
- par défaut : `$route.fullPath`
13+
- par défaut : `$route.path`
1414

1515
Exemple (`layouts/default.vue`) :
1616

id/api/components-nuxt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: Menampilkan komponen halaman di dalam layout
1111

1212
- nuxtChildKey: `string`
1313
- Prop ini di-set ke `<router-view/>`, berguna untuk membuat transisi di dalam halaman yang dinamis dan rute yang berbeda.
14-
- Default: `$route.fullPath`
14+
- Default: `$route.path`
1515

1616
Contoh (`layouts/default.vue`):
1717

ja/api/components-nuxt.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ description: レイアウト内でページコンポーネントを表示しま
77

88
> このコンポーネントは [レイアウト](/guide/views#%E3%83%AC%E3%82%A4%E3%82%A2%E3%82%A6%E3%83%88) 内でのみ、ページコンポーネントを表示するために使われます。
99
10-
**Props**:
11-
12-
- nuxt 子キー:`string`
13-
- この prop は `<router-view/>` に設定され、動的なページと異なるルートの中で遷移させるのに便利です
14-
- デフォルト: `$route.fullPath`
15-
1610
例(`layouts/default.vue`):
1711

1812
```html
@@ -27,8 +21,40 @@ description: レイアウト内でページコンポーネントを表示しま
2721

2822
実際の例を見たいときは [レイアウトの例](/examples/layouts) を参照してください。
2923

30-
- 名前:`string` (_Nuxt v2.4.0で導入されました_)
31-
- この prop は `<router-view/>` に設定され、ページコンポーネントの名前付きビューをレンダリングするのに利用されます
24+
**Props**:
25+
26+
- nuxtChildKey:`string`
27+
- この prop は `<router-view/>` に設定され、動的なページと異なるルートの中で遷移させるのに便利です
28+
- デフォルト: `$route.path`
29+
30+
`<router-view/>``key` prop を操作する方法は3つあります。
31+
32+
1. `nuxtChildKey` prop
33+
34+
```html
35+
<template>
36+
<div>
37+
<nuxt :nuxt-child-key="someKey"/>
38+
</div>
39+
</template>
40+
```
41+
42+
2. 各ページコンポーネントの `key` オプション: `string` or `function`
43+
44+
```js
45+
export default {
46+
key(route) {
47+
return route.fullPath
48+
}
49+
}
50+
```
51+
52+
3. 各ページコンポーネントの `watchQuery` オプション: `boolean` or `string[]`
53+
54+
[watchQuery](/api/pages-watchquery) に設定されたクエリはキーを生成するとき考慮されます。 `watchQuery``true` の場合は `fullPath` が使われます。
55+
56+
- name:`string` (_Nuxt v2.4.0で導入されました_)
57+
- この prop は `<router-view/>` に設定され、ページコンポーネントの名前付きビューをレンダリングするのに利用されます。
3258
- デフォルト: `default`
3359

3460
実際の例を見たいときは [名前付きビューの例](/examples/named-views) を参照してください。

ko/api/components-nuxt.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,41 @@ description: 레이아웃 내부의 페이지 컴포넌트를 보여줍니다.
2020
```
2121

2222
[layouts example](/examples/layouts)에서 예제를 보실 수 있습니다.
23+
24+
**Props**:
25+
26+
- nuxtChildKey: `string`
27+
- 이 속성은 `<router-view/>``key`속성으로 설정됩니다. 동적 페이지에서 여러 라우트간의 트랜지션을 만드는 경우 유용합니다.
28+
- 기본값: `$route.path`
29+
30+
`<router-view/>``key`속성을 설정하는 방법은 3가지가 있습니다.
31+
32+
1. `nuxtChildKey` 속성
33+
34+
```html
35+
<template>
36+
<div>
37+
<nuxt :nuxt-child-key="someKey"/>
38+
</div>
39+
</template>
40+
```
41+
42+
2. 각 페이지 컴포넌트의 `key` 옵션: `string` or `function`
43+
44+
```js
45+
export default {
46+
key(route) {
47+
return route.fullPath
48+
}
49+
}
50+
```
51+
52+
3. 각 페이지 컴포넌트의 `watchQuery` 옵션: `boolean` or `string[]`
53+
54+
[watchQuery](/api/pages-watchquery) 옵션에 설정한 쿼리는 키를 생성할 때 고려됩니다. 만약 `watchQuery``true`라면 `fullPath`를 사용하게 됩니다.
55+
56+
- name: `string` (_introduced with Nuxt v2.4.0_)
57+
- 이 속성은 `<router-view/>`의 속성으로 설정됩니다. 페이지 컴포넌트의 named-view를 렌더링 하는데 사용됩니다.
58+
- 기본값: `default`
59+
60+
[named-views example](/examples/named-views)에서 예제를 보실 수 있습니다.

zh/api/components-nuxt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: 该组件用于在布局中显示页面组件(即非布局内容
1010
**Props**:
1111
- nuxtChildKey: `string`
1212
- 此prop将设置为`<router-view />`,可用于在动态页面和不同路径内进行转换。
13-
- 默认: `$route.fullPath`
13+
- 默认: `$route.path`
1414

1515
例如 (`layouts/default.vue`):
1616

0 commit comments

Comments
 (0)