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
I guess to summarize the problem for anyone else, when the list is cleared, both of the v-if conditions are now false (list.length and list[0].text). However the inner condition (list[0].text) is still executed, resulting in an error, even though it should have been skipped due to the outer condition evaluating to false.
So it looks like v-ifs should be evaluated hierachically instead of in the order they are evaluated now.
Demo: http://jsfiddle.net/e9e2bw6v/2/
We have list, which is under watching. In watch we just replace text:null to text: 'some text'.
When we add an item, and later we clear list, we see error.
We have html:
<div v-if="list.length">
<div v-if="list[0].text">
{{list[0].text}}
</div>
</div>
If we remove second condition, we will not have error.
If you replace 2 conditions to 1
<div v-if="list.length && list[0].text">
, we will not have error.I cannot explain this, but its wrong.
P.S. Sory for bad english.
The text was updated successfully, but these errors were encountered: