Skip to content

Commit c2fc1d2

Browse files
MarkTallentireNataliaTepluhina
authored andcommitted
Update Prop Mutation Docs to be more clear around mutation (#1365)
* Update Prop Mutation Docs to be more clear around mutation * Update src/guide/component-props.md Co-authored-by: Natalia Tepluhina <[email protected]>
1 parent 2679a03 commit c2fc1d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/component-props.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ computed: {
154154
}
155155
```
156156

157-
::: tip Note
158-
JavaScript のオブジェクトと配列は、参照として渡されるため、子コンポーネント内で配列やオブジェクトを変更すると、 **親の状態に影響を与える** ことに注意してください
157+
::: warning Warning
158+
JavaScript のオブジェクトや配列は参照渡しなので、プロパティが配列やオブジェクトの場合、子コンポーネント内でオブジェクトや配列自体を変更すると、親の状態に **影響してしまい**、Vue はこれに対して警告できないことに注意してください。一般的なルールとして、オブジェクトや配列を含むプロパティの変更は避けるべきです。これは単方向のデータバインディングが無視されてしまい、望ましくない結果を引き起こす可能性があるからです
159159
:::
160160

161161
## プロパティのバリデーション

0 commit comments

Comments
 (0)