Skip to content

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

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 2 commits into from
Feb 27, 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 @@ -627,6 +627,14 @@ For the child component to update `foo`'s value, it needs to explicitly emit an
this.$emit('update:foo', newValue)
```

The `.sync` modifier can also be used with `v-bind` when using an object to set multiple properties at once:

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

This has the effect of adding `v-on` update listeners for both `foo` and `bar`.

### Form Input Components using Custom Events

Custom events can also be used to create custom inputs that work with `v-model`. Remember:
Expand Down