question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem when use v-else or v-else-if with v-for.

See original GitHub issue

Vue.js version

2.0.3

Reproduction Link

https://jsfiddle.net/7bhmonyv/1/ https://jsfiddle.net/7bhmonyv/3/ (Resolution)

Steps to reproduce

  1. Use v-if with v-for in v-for.
  2. And then use v-else-if or v-else with v-for.

What is Expected?

A

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

B

  • 1
  • 2
  • 5
  • 7
  • 8
  • 1

C

  • [6]
  • [3]
  • [6]
  • [2]
  • [7]
  • [3]

What is actually happening?

A

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

B

  • 1
  • 2
  • 5
  • 7
  • 8
  • 1
  • 1
  • 2
  • 5
  • 7 …

C

  • [6]
  • [3]
  • [6]
  • [2]
  • [7]
  • [3]
  • [6]
  • [3]
  • [6]
  • [2]
  • [7]
  • [3] …

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
defcccommented, Dec 21, 2016

Currently v-for has higher priority. Maybe we need to make it explicitly in the document.

2reactions
yyx990803commented, Dec 22, 2016

This is expected behavior, we will improve the docs to make the priority more obvious.

In the meanwhile your template can be simplified with a filter: https://jsfiddle.net/7bhmonyv/4/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Else clause on Python while statement - syntax - Stack Overflow
The else clause is only executed when your while condition becomes false. If you break out of the loop, or if an exception...
Read more >
'Versus' vs. 'Verses' - Merriam-Webster
Versus is a preposition, with the meaning of “against,” or “in contrast to or as the alternative of.” In use in English since...
Read more >
Common Writing Problems & How to Fix Them
Here are brief descriptions of common writing problems. ... If you think "identify with" means anything else, you're suggesting that you think literary ......
Read more >
Proverbs 4:23 - Above all else, guard your heart, for ...
23 Keep thy heart with all diligence; for out of it are the issues of life. ESV. 23 Keep your heart with all...
Read more >
Congregational Conflict Resolution And The Use Of Scriptures
Proverbs chapter 14, verse 17 touches on the problem of being quick to anger: “ A quick tempered man acts foolishly…”. On the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found