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

2.7 #1370

Merged
merged 3 commits into from
May 14, 2019
Merged

2.7 #1370

Show file tree
Hide file tree
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
43 changes: 38 additions & 5 deletions de/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ description: Display the page components inside a layout.

> This component is used only in [layouts](/guide/views#layouts) to display the page components.

**Props**:
- nuxtChildKey: `string`
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
- Default: `$route.fullPath`

Example (`layouts/default.vue`):

```html
Expand All @@ -25,3 +20,41 @@ Example (`layouts/default.vue`):
```

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

**Props**:

- nuxtChildKey: `string`
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
- Default: `$route.path`

There are 3 ways to handle internal `key` prop of `<router-view/>`.

1. `nuxtChildKey` prop

```html
<template>
<div>
<nuxt :nuxt-child-key="someKey"/>
</div>
</template>
```

2. `key` option in page components: `string` or `function`

```js
export default {
key(route) {
return route.fullPath
}
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`

To see an example, take a look at the [named-views example](/examples/named-views).
38 changes: 32 additions & 6 deletions en/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: Display the page components inside a layout.

> This component is used only in [layouts](/guide/views#layouts) to display the page components.

**Props**:

- nuxtChildKey: `string`
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
- Default: `$route.fullPath`

Example (`layouts/default.vue`):

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

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

**Props**:

- nuxtChildKey: `string`
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
- Default: `$route.path`

There are 3 ways to handle internal `key` prop of `<router-view/>`.

1. `nuxtChildKey` prop

```html
<template>
<div>
<nuxt :nuxt-child-key="someKey"/>
</div>
</template>
```

2. `key` option in page components: `string` or `function`

```js
export default {
key(route) {
return route.fullPath
}
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`
Expand Down
69 changes: 42 additions & 27 deletions en/api/configuration-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {

> Customize Babel configuration for JavaScript and Vue files. `.babelrc` is ignored by default.

- Type: `Object`
- Type: `Object` See `babel-loader` [options](https://github.com/babel/babel-loader#options) and `babel` [options](https://babeljs.io/docs/en/options)
- Default:

```js
Expand All @@ -50,52 +50,53 @@ export default {
presets: ['@nuxt/babel-preset-app']
}
```


The default targets of [@nuxt/babel-preset-app](https://github.com/nuxt/nuxt.js/blob/dev/packages/babel-preset-app/src/index.js) are `ie: '9'` in the `client` build, and `node: 'current'` in the `server` build.

**Note**: The presets configured in `build.babel.presets` will be applied to both, the client and the server build. The target will be set by Nuxt accordingly (client/server). If you want configure the preset differently for the client or the server build, please use `presets` as a function:
### presets

```js
export default {
build: {
babel: {
presets({ isServer }) {
const targets = isServer ? { node: '10' } : { ie: '11' }
return [
[ require.resolve('@nuxt/babel-preset-app'), { targets } ]
]
}
}
}
}
```
- Type: `Function`
- Argument:
1. `Object`: { isServer: true | false }
2. `Array`:
- preset name `@nuxt/babel-preset-app`
- [`options`](https://github.com/nuxt/nuxt.js/tree/dev/packages/babel-preset-app#options) of `@nuxt/babel-preset-app`

**Note**: The presets configured in `build.babel.presets` will be applied to both, the client and the server build. The target will be set by Nuxt accordingly (client/server). If you want configure the preset differently for the client or the server build, please use `presets` as a function:

We **highly recommend** to use the default preset. However, you can change the preset if you have to.
> We **highly recommend** to use the default preset instead of below customization

*Example* for custom presets:
```js
export default {
build: {
babel: {
presets: ['es2015', 'stage-0']
presets({ isServer }, [ preset, options ]) {
// change options directly
options.targets = isServer ? ... : ...
options.corejs = ...
// return nothing
}
}
}
}
```

> Default targets of [@nuxt/babel-preset-app](https://github.com/nuxt/nuxt.js/blob/dev/packages/babel-preset-app/src/index.js) is : `ie: '9'` in `client` building, `node: 'current'` in `server` side.

**Note**: the presets in configured in `build.babel.presets` will be applied to both client and server build, the target will be set by Nuxt according to the building (client/server), if you want to set different config, please use presets as a function:
Or override default value by returning whole presets list:

```js
export default {
build: {
babel: {
presets({ isServer }) {
const targets = isServer ? { node: '10' } : { ie: '11' }
presets({ isServer }, [ preset, options ]) {
return [
[ require.resolve('@nuxt/babel-preset-app'), { targets } ]
[
preset, {
buildTarget: isServer ? 'server' : 'client',
...options
}],
[
// Other presets
]
]
}
}
Expand Down Expand Up @@ -691,7 +692,8 @@ If you want to transpile specific dependencies with Babel, you can add them in `

```js
{
typeCheck: true
typeCheck: true,
ignoreNotFoundWarnings: false
}
```

Expand All @@ -706,6 +708,19 @@ When enabled, Nuxt.js uses [fork-ts-checker-webpack-plugin](https://github.com/R

You can use an `Object` to override plugin options or set it to `false` to disable it.

### typescript.ignoreNotFoundWarnings

> Enables suppress not found typescript warnings.

- Type: `Boolean`
- Default: `false`

When enabled, you can suppress `export ... was not found ...` warnings.

See also about background information [https://github.com/TypeStrong/ts-loader/issues/653](https://github.com/TypeStrong/ts-loader/issues/653)

**Warning:** This property might suppress the warnings you want to see. Be careful with how you configure it.

## vueLoader

> Note: This config has been removed since Nuxt 2.0, please use [`build.loaders.vue`](#loaders)instead.
Expand Down
38 changes: 38 additions & 0 deletions es/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,41 @@ Example (`layouts/default.vue`):
```

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

**Props**:

- nuxtChildKey: `string`
- This prop will be set to `<router-view/>`, useful to make transitions inside a dynamic page and different route.
- Default: `$route.path`

There are 3 ways to handle internal `key` prop of `<router-view/>`.

1. `nuxtChildKey` prop

```html
<template>
<div>
<nuxt :nuxt-child-key="someKey"/>
</div>
</template>
```

2. `key` option in page components: `string` or `function`

```js
export default {
key(route) {
return route.fullPath
}
}
```

3. `watchQuery` option in page components: `boolean` or `string[]`

Queries specified in [watchQuery](/api/pages-watchquery) option will be considered on building the key. If `watchQuery` is `true`, `fullPath` is used.

- name: `string` (_introduced with Nuxt v2.4.0_)
- This prop will be set to `<router-view/>`, used to render named-view of page component.
- Default: `default`

To see an example, take a look at the [named-views example](/examples/named-views).
2 changes: 1 addition & 1 deletion fr/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Affiche un composant de page à l'intérieur d'une mise en page.
**Props** :
- nuxtChildKey : `string`
- 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.
- par défaut : `$route.fullPath`
- par défaut : `$route.path`

Exemple (`layouts/default.vue`) :

Expand Down
2 changes: 1 addition & 1 deletion id/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Menampilkan komponen halaman di dalam layout

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

Contoh (`layouts/default.vue`):

Expand Down
42 changes: 34 additions & 8 deletions ja/api/components-nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: レイアウト内でページコンポーネントを表示しま

> このコンポーネントは [レイアウト](/guide/views#%E3%83%AC%E3%82%A4%E3%82%A2%E3%82%A6%E3%83%88) 内でのみ、ページコンポーネントを表示するために使われます。

**Props**:

- nuxt 子キー:`string`
- この prop は `<router-view/>` に設定され、動的なページと異なるルートの中で遷移させるのに便利です
- デフォルト: `$route.fullPath`

例(`layouts/default.vue`):

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

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

- 名前:`string` (_Nuxt v2.4.0で導入されました_)
- この prop は `<router-view/>` に設定され、ページコンポーネントの名前付きビューをレンダリングするのに利用されます
**Props**:

- nuxtChildKey:`string`
- この prop は `<router-view/>` に設定され、動的なページと異なるルートの中で遷移させるのに便利です
- デフォルト: `$route.path`

`<router-view/>` の `key` prop を操作する方法は3つあります。

1. `nuxtChildKey` prop

```html
<template>
<div>
<nuxt :nuxt-child-key="someKey"/>
</div>
</template>
```

2. 各ページコンポーネントの `key` オプション: `string` or `function`

```js
export default {
key(route) {
return route.fullPath
}
}
```

3. 各ページコンポーネントの `watchQuery` オプション: `boolean` or `string[]`

[watchQuery](/api/pages-watchquery) に設定されたクエリはキーを生成するとき考慮されます。 `watchQuery` が `true` の場合は `fullPath` が使われます。

- name:`string` (_Nuxt v2.4.0で導入されました_)
- この prop は `<router-view/>` に設定され、ページコンポーネントの名前付きビューをレンダリングするのに利用されます。
- デフォルト: `default`

実際の例を見たいときは [名前付きビューの例](/examples/named-views) を参照してください。
17 changes: 16 additions & 1 deletion ja/api/configuration-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ Terser プラグインのオプションです。 `false` を設定するとこ

```js
{
typeCheck: true
typeCheck: true,
ignoreNotFoundWarnings: false
}
```

Expand All @@ -613,6 +614,20 @@ When enabled, Nuxt.js uses [fork-ts-checker-webpack-plugin](https://github.com/R

You can use an `Object` to override plugin options or set it to `false` to disable it.

### typescript.ignoreNotFoundWarnings

> typescript の not foundの warning を抑制します。

- 型: `Boolean`
- デフォルト: `false`

有効にすると、`export ... was not found ...` の warning を抑制することが出来ます。

背景についてはこちらも参照してください。 [https://github.com/TypeStrong/ts-loader/issues/653](https://github.com/TypeStrong/ts-loader/issues/653)

**警告:** このプロパティは本来見たい warning も抑制する可能性があります。設定には注意してください。


## vueLoader

> 注意: この設定は Nuxt 2.0 から削除されました。[`build.loaders.vue`](#loaders) を変わりに使用してください。
Expand Down
Loading