Skip to content

Commit 982d144

Browse files
davidkhesschrisvfritz
authored andcommitted
Add a mention of support for v-bind.sync (#1459)
* Add a mention of support for v-bind.sync * Remove unnecessary quotes from v-bind example
1 parent 004389d commit 982d144

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/v2/guide/components.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,14 @@ For the child component to update `foo`'s value, it needs to explicitly emit an
627627
this.$emit('update:foo', newValue)
628628
```
629629

630+
The `.sync` modifier can also be used with `v-bind` when using an object to set multiple properties at once:
631+
632+
```html
633+
<comp v-bind.sync="{ foo: 1, bar: 2 }"></comp>
634+
```
635+
636+
This has the effect of adding `v-on` update listeners for both `foo` and `bar`.
637+
630638
### Form Input Components using Custom Events
631639

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

0 commit comments

Comments
 (0)