Please see here:
https://jsfiddle.net/tys426eq/
If a class has its own iterator, v-for should iterate over this, instead of the object properties
class Items {
[Symbol.iterator]() {
return this.all.values();
}
}
...
<div v-for="item of items"> (or "in")
If I recall correctly this is planned for v3 and may be added in v2
Other issues #5893, #6079
PR: https://github.com/vuejs/vue/pull/7171, https://github.com/vuejs/vue/pull/8179
This is working since vue 2.6.x
core/v-for: support iterables in v-for (#8179) d40eb9c, closes #8179
Most helpful comment
If I recall correctly this is planned for v3 and may be added in v2
Other issues #5893, #6079
PR: https://github.com/vuejs/vue/pull/7171, https://github.com/vuejs/vue/pull/8179