v-for iterating over v-else
See original GitHub issueVersion
2.5.17
Reproduction link
https://jsfiddle.net/hirokiosame/7mfcktv4/
Steps to reproduce
Add a v-for
and v-if
to an element with a v-else sibling. If the v-if condition evaluates to be falsy, the iteration happens over the v-else
element.
What is expected?
For the v-for to not iterate over the v-else
What is actually happening?
The v-for is iterating over the v-else
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How To Iterate Over Items in Vue.js With V-for
We can loop over the items in a shoppingItems array from the data model. This can be accomplished by adding the v-for directive...
Read more >How to Iterate Through a Dictionary in Python
In this step-by-step tutorial, you'll take a deep dive into how to iterate through a dictionary in Python. Dictionaries are a fundamental data...
Read more >How to Write Better Vue v-for Loops
v-for is most commonly used to render items in a list, but can also be used to iterate over an object's properties or...
Read more >Iterate over a dictionary in Python
Iterate over a dictionary in Python · Access key using the build .keys() · Access key without using a key() · Iterate through...
Read more >Looping through Object Properties in Vue
This outputs a list with both the object keys and their corresponding values. You might be wondering why the second alias is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To be clear, the bug I’m reporting isn’t that v-for is happening before v-if. It’s that the v-for is being applied to code outside of the iteration.
What’s happening:
Expected behavior:
https://vuejs.org/v2/style-guide/#Avoid-v-if-with-v-for-essential
https://jsfiddle.net/rhxpnbty/