Skip to content

Add a mention of support for v-bind.sync #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2018
Merged
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
8 changes: 8 additions & 0 deletions src/v2/guide/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,14 @@ new Vue({
this.$emit('update:foo', newValue)
```

`.sync` 修飾子は、オブジェクトを使用して複数のプロパティを一度に設定するときに `v-bind` とともに使うこともできます:

```html
<comp v-bind.sync="{ foo: 1, bar: 2 }"></comp>
```

これは `foo` と `bar`の両方に対して `v-on` アップデートリスナーを追加する効果があります。

### カスタムイベントを使用したフォーム入力コンポーネント

カスタムイベントは、`v-model`とともに動く、カスタムフォーム入力を作成するためにも使用されます。以下を思い出しましょう:
Expand Down