-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Binding v-model to array items #530
Comments
There are some limitations with arrays of primitive values - but if you use arrays of objects it will work: http://jsfiddle.net/xb5h545w/1/ |
I hope this was mentioned in the documentations |
To be clear, you have to use index operator instead of v-for? |
@Jugbot, you need to use https://vuejs.org/v2/guide/list.html#Maintaining-State <li v-for="item in items" :key="item"></li>
<!-- OR -->
<li v-for="(item, index) in items" :key="index"></li>
|
Following #333, any chance to support binding to array items out of the box?
http://jsfiddle.net/xb5h545w/
I guess the directive would have to convert
items[0]
intoitems.$set(0, x)
.The text was updated successfully, but these errors were encountered: