-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
problem with v-repeat and remove all #213
Comments
@ljonathanl I think this is the intended behavior. When you assign If you use |
Thank you for the answer but I do not agree with you, data (or model) does not belong only to a Vue, see my update of the fiddle: http://jsfiddle.net/4JGRy/1/ And empty array is not a solution because data (or model) does not belong only to a Vue. var model = {items: [1,2,3]};
var list = new Vue({data: {items: model.items}}); if I set list.items with an empty array I lost my reference with the model. |
The auto-sync back when an identifier is used causes issues such as #213 and #234, while the feature is a rarely used edge case that is also a bit magical. It can be easily circumvented by using object arrays instead of primitive ones, and the sync-back is better left in userland for those who really need it. For reference, Angular also doesn't support sync back for primitive values.
Hi,
I have found a problem with v-repeat when you remove all items of a list and set a value of a removed item during the same frame. Item will reappear in the list and linked view too.
You can see this fiddle for a real example : http://jsfiddle.net/4JGRy/
The "newValue" should not be visible because all items of the list have been removed.
NB: I really appreciate this library, good job ;)
Edit: replace gist by a fidlle
The text was updated successfully, but these errors were encountered: