Closed baiyaaaaa closed 8 years ago
This looks like a bug to me. Workaround
+1 If we use v-if="customItem"
instead of v-else
it works fine. Looks like it comes from the v-else
directive.
v-for
followed by an element using v-else
does not play nice together, because v-if relys on the previous sibling elements v-if result - but there can be more than one, as v-if
is evaluated after v-for
so evaluated for each item in the loop.
This can lead to unexpected behaviour.
You can surround the element with a template
and use the v-if
/v-else
there:
https://jsfiddle.net/frfekkf5/7/
Vue.js version
2.0.0-rc.2
Reproduction Link
https://jsfiddle.net/WhiteCusp/frfekkf5/3/
Steps to reproduce
just run
What is Expected?
0-aaaa 1-bbbb 2-cccc
What is actually happening?
0-aaaa 1-bbbb 2-cccc 0-aaaa 1-bbbb 2-cccc 0-aaaa 1-bbbb 2-cccc