You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterate with v-for on a class with Symbol.iterator (which does something with the returning value). See jsfiddle!
What is expected?
since 2.6-beta1 it should support iterables in v-for (#8179) d40eb9c, (#8179)
I thought, great, let's try this with my footnote class and get rid of that verbose "getItems()" accessor and directly pass the class with a Symbol.iterator.
What is actually happening?
But as soon as the values which should be iterated are mutated before they are returned (e.g. sort), it shows the Vue warn:
"You may have an infinite update loop in a component render function."
And the iterator gets called over 100 times.
Even worse, if you put this class in a vuex state. Then it complains that it cannot be mutated (even though I don't actually mutate it)
The text was updated successfully, but these errors were encountered:
plehnen
changed the title
v-for class with Symbol.iterator not working properly when returning objects
v-for class with Symbol.iterator not working properly when return value is modified
Feb 4, 2019
Version
2.6.0-beta.3
Reproduction link
https://jsfiddle.net/vx1ygurm/
Steps to reproduce
Iterate with v-for on a class with Symbol.iterator (which does something with the returning value). See jsfiddle!
What is expected?
since 2.6-beta1 it should support iterables in v-for (#8179) d40eb9c, (#8179)
I thought, great, let's try this with my footnote class and get rid of that verbose "getItems()" accessor and directly pass the class with a Symbol.iterator.
What is actually happening?
But as soon as the values which should be iterated are mutated before they are returned (e.g. sort), it shows the Vue warn:
"You may have an infinite update loop in a component render function."
And the iterator gets called over 100 times.
Even worse, if you put this class in a vuex state. Then it complains that it cannot be mutated (even though I don't actually mutate it)
The text was updated successfully, but these errors were encountered: