Skip to content

Commit ef9d733

Browse files
authored
Merge pull request #147 from nalpan/translate-data-option
Translate: Migration Guide > Data Option
2 parents 39e133f + cf116b4 commit ef9d733

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/guide/migration/data-option.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
title: Data Option
2+
title: Data オプション
33
badges:
44
- breaking
55
---
66

77
# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
88

9-
## Overview
9+
## 概要
1010

11-
- **BREAKING**: `data` component option declaration no longer accepts a plain JavaScript `object` and expects a `function` declaration.
11+
`data` コンポーネントオプション宣言はプレーンな JavaScript `object` を受け入れず、`function` 宣言を期待します。
1212

13-
## 2.x Syntax
13+
## 2.x での構文
1414

15-
In 2.x, developers could define the `data` option with either an `object` or a `function`.
15+
2.x では、`data` オプションは `object` `function` のどちらか一方で定義できました。
1616

17-
For example:
17+
:
1818

1919
```html
20-
<!-- Object Declaration -->
20+
<!-- オブジェクト宣言 -->
2121
<script>
2222
const app = new Vue({
2323
data: {
@@ -26,7 +26,7 @@ For example:
2626
})
2727
</script>
2828

29-
<!-- Function Declaration -->
29+
<!-- 関数宣言 -->
3030
<script>
3131
const app = new Vue({
3232
data() {
@@ -38,13 +38,13 @@ For example:
3838
</script>
3939
```
4040

41-
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.
41+
これは状態が共有されているルートインスタンスに関してはある程度の利便性をもたらしましたが、ルートインスタンスでのみ可能であるという事実のため混乱を招きました。
4242

43-
## 3.x Update
43+
## 3.x での更新
4444

45-
In 3.x, the `data` option has been standardized to only accept a `function` that returns an `object`.
45+
3.x では、 `data` オプションは `object` を返す `function` 宣言のみ受け入れるよう標準化されました。
4646

47-
Using the example above, there would only be one possible implementation of the code:
47+
上記を例にすると、コードの可能な実装は1つだけです:
4848

4949
```html
5050
<script>
@@ -60,9 +60,9 @@ Using the example above, there would only be one possible implementation of the
6060
</script>
6161
```
6262

63-
## Migration Strategy
63+
## 移行の戦略
6464

65-
For users relying on the object declaration, we recommend:
65+
オブジェクト宣言を利用しているユーザーには以下を推奨します:
6666

67-
- Extracting the shared data into an external object and using it as a property in `data`
68-
- Rewrite references to the shared data to point to a new shared object
67+
- 共有データを外部オブジェクトとして抽出し、それを `data` のプロパティとして使う
68+
- 共有データへの参照、新しい共有オブジェクトを指すようにを書き換える

0 commit comments

Comments
 (0)