Skip to content

Commit 7575a61

Browse files
authored
Merge pull request #141 from u-sho/migration-guide/async-components
Migration Guide > Async Components の翻訳
2 parents 1f1cd2e + ab73be8 commit 7575a61

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/guide/migration/async-components.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ badges:
33
- new
44
---
55

6-
# Async Components <MigrationBadges :badges="$frontmatter.badges" />
6+
# 非同期コンポーネント <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## 概要
99

10-
Here is a high level overview of what has changed:
10+
こちらが大まかな変更の概要です:
1111

12-
- New `defineAsyncComponent` helper method that explicitly defines async components
13-
- `component` option renamed to `loader`
14-
- Loader function does not inherently receive `resolve` and `reject` arguments and must return a Promise
12+
- 明示的に非同期コンポーネントを定義する、新しい `defineAsyncComponent` ヘルパーメソッド
13+
- `component` オプションは `loader` に名前が替わりました
14+
- loader 関数は本質的に `resolve` `reject` を引数にとらず、必ず Promise を返却します
1515

16-
For a more in-depth explanation, read on!
16+
さらに詳しい説明のために読み進めましょう!
1717

18-
## Introduction
18+
## イントロダクション
1919

20-
Previously, async components were created by simply defining a component as a function that returned a promise, such as:
20+
以前、非同期コンポーネントは Promise を返す関数としてコンポーネントを定義することで、このように簡単に作成されました:
2121

2222
```js
2323
const asyncPage = () => import('./NextPage.vue')
2424
```
2525

26-
Or, for the more advanced component syntax with options:
26+
または、オプション付きのさらに高度なコンポーネント構文として:
2727

2828
```js
2929
const asyncPage = {
@@ -35,19 +35,19 @@ const asyncPage = {
3535
}
3636
```
3737

38-
## 3.x Syntax
38+
## 3.x での構文
3939

40-
Now, in Vue 3, since functional components are defined as pure functions, async components definitions need to be explicitly defined by wrapping it in a new `defineAsyncComponent` helper:
40+
現在、Vue 3 では、関数型コンポーネントは純粋関数として定義されるので、非同期コンポーネントは新しい `defineAsyncComponent` ヘルパーでラップして定義する必要があります:
4141

4242
```js
4343
import { defineAsyncComponent } from 'vue'
4444
import ErrorComponent from './components/ErrorComponent.vue'
4545
import LoadingComponent from './components/LoadingComponent.vue'
4646

47-
// Async component without options
47+
// オプションなしの非同期コンポーネント
4848
const asyncPage = defineAsyncComponent(() => import('./NextPage.vue'))
4949

50-
// Async component with options
50+
// オプション付きの非同期コンポーネント
5151
const asyncPageWithOptions = defineAsyncComponent({
5252
loader: () => import('./NextPage.vue'),
5353
delay: 200,
@@ -57,7 +57,7 @@ const asyncPageWithOptions = defineAsyncComponent({
5757
})
5858
```
5959

60-
Another change that has been made from 2.x is that the `component` option is now renamed to `loader` in order to accurately communicate that a component definition cannot be provided directly.
60+
2.x からなされたもう一つの変更は、直接コンポーネント定義を提供できないことを正確に伝えるために `component` オプションの名前が `loader` に替わったことです。
6161

6262
```js{4}
6363
import { defineAsyncComponent } from 'vue'
@@ -71,7 +71,7 @@ const asyncPageWithOptions = defineAsyncComponent({
7171
})
7272
```
7373

74-
In addition, unlike 2.x, the loader function no longer receives the `resolve` and `reject` arguments and must always return a Promise.
74+
加えて、2.x とは異なり、loader 関数はもう `resolve` `reject` を引数にとらず、常に Promise を返します。
7575

7676
```js
7777
// 2.x version
@@ -88,6 +88,6 @@ const asyncComponent = defineAsyncComponent(
8888
)
8989
```
9090

91-
For more information on the usage of async components, see:
91+
非同期コンポーネントの使い方のさらなる情報は、以下を見てください:
9292

93-
- [Guide: Dynamic & Async Components](/guide/component-dynamic-async.html#dynamic-components-with-keep-alive)
93+
- [ガイド: 動的 & 非同期コンポーネント](/guide/component-dynamic-async.html#動的コンポーネントにおける-keep-alive-の利用)

0 commit comments

Comments
 (0)