Vue: .sync modifier doesn't work for deeply nested object in a v-for

Created on 19 Jun 2018  ·  3Comments  ·  Source: vuejs/vue

Version

2.5.16

Reproduction link

https://jsfiddle.net/jacobgoh101/g5bv0esd/1/

Steps to reproduce

Using .sync modifier for an array of objects in a v-for loop

What is expected?

.sync modifier should update parent's data

What is actually happening?

.sync modifier doesn't update parent's data


Manually adding events handler works. But .sync modifier doesn't.

Most helpful comment

All 3 comments

It should be $emit('update:itemAttribute', value), see https://jsfiddle.net/g5bv0esd/5/

@javoski Please consider re-opening. The official guide, in the same section where the .sync is documented, states:

... we recommend you always use kebab-case for event names.

This has bitten me as well. Either the docs needs fixing or the code does.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdedardel picture bdedardel  ·  3Comments

6pm picture 6pm  ·  3Comments

bfis picture bfis  ·  3Comments

seemsindie picture seemsindie  ·  3Comments

paulpflug picture paulpflug  ·  3Comments