From 4ad288b6796a18b651836a2a77c7985239029467 Mon Sep 17 00:00:00 2001 From: nal Date: Tue, 27 Oct 2020 01:20:42 +0900 Subject: [PATCH 1/3] Translate: Migration Guide > Data Option --- src/guide/migration/data-option.md | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/guide/migration/data-option.md b/src/guide/migration/data-option.md index 513f3edb..c2e6096a 100644 --- a/src/guide/migration/data-option.md +++ b/src/guide/migration/data-option.md @@ -1,23 +1,22 @@ --- -title: Data Option badges: - breaking --- -# {{ $frontmatter.title }} +# Data オプション -## Overview +## 概要 -- **BREAKING**: `data` component option declaration no longer accepts a plain JavaScript `object` and expects a `function` declaration. +`data` コンポーネントオプション宣言はプレーンな JavaScript `object` を受け入れず、`function` 宣言を期待します。 -## 2.x Syntax +## 2.x での構文 -In 2.x, developers could define the `data` option with either an `object` or a `function`. +2.x では、`data` オプションは `object` か `function` のどちらか一方で定義できました。 -For example: +例: ```html - + - + ``` -Though this provided some convenience in terms of root instances having a shared state, this has led to confusion due to the fact that its only possible on the root instance. +これは共有状態を持っているルートインスタンスに関してはある程度の利便性をもたらしましたが、ルートインスタンスでのみ可能であるという事実のため混乱を招きました。 -## 3.x Update +## 3.x での更新 -In 3.x, the `data` option has been standardized to only accept a `function` that returns an `object`. +3.x では、 `data` オプションは `object` を返す `function` 宣言のみ受け入れるよう標準化されました。 -Using the example above, there would only be one possible implementation of the code: +上記を例にすると、コードの可能な実装は1つだけです: ```html ``` -## Migration Strategy +## 移行の戦略 -For users relying on the object declaration, we recommend: +オブジェクト宣言を利用しているユーザーには以下を推奨します: -- Extracting the shared data into an external object and using it as a property in `data` -- Rewrite references to the shared data to point to a new shared object +- 共有データを外部オブジェクトとして抽出し、それを `data` のプロパティとして使う +- 共有データへの参照、新しい共有オブジェクトを指すようにを書き換える From e8cebe5fa571f758f75f5927abfd6b15ee340cf7 Mon Sep 17 00:00:00 2001 From: nal Date: Mon, 2 Nov 2020 00:17:55 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=81=ABfrontmatter=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/guide/migration/data-option.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/guide/migration/data-option.md b/src/guide/migration/data-option.md index c2e6096a..b5ecb39f 100644 --- a/src/guide/migration/data-option.md +++ b/src/guide/migration/data-option.md @@ -1,9 +1,10 @@ --- +title: Data オプション badges: - breaking --- -# Data オプション +# {{ $frontmatter.title }} ## 概要 From 9f895718f8afcd5c4174afef0c67779cbb8148b4 Mon Sep 17 00:00:00 2001 From: nal Date: Mon, 2 Nov 2020 00:19:21 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20shared=20state=E3=81=AE=E8=A8=B3?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/guide/migration/data-option.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/migration/data-option.md b/src/guide/migration/data-option.md index b5ecb39f..5dd42f06 100644 --- a/src/guide/migration/data-option.md +++ b/src/guide/migration/data-option.md @@ -38,7 +38,7 @@ badges: ``` -これは共有状態を持っているルートインスタンスに関してはある程度の利便性をもたらしましたが、ルートインスタンスでのみ可能であるという事実のため混乱を招きました。 +これは状態が共有されているルートインスタンスに関してはある程度の利便性をもたらしましたが、ルートインスタンスでのみ可能であるという事実のため混乱を招きました。 ## 3.x での更新