-
-
Couldn't load subscription status.
- Fork 695
Closed
Description
Please describe what the rule should do:
Provide a warning when using v-if on the same element as v-for.
What category of rule is this? (place an "X" next to just one item)
[x] Enforces code style
[ ] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
<PostCard
v-for="page in pages"
v-if="isVisiblePost(page)"
:key="page.key"
:page="page"
:showContent="false"
:showLink="true"
/><ul>
<li
v-for="user in users"
v-if="shouldShowUsers"
:key="user.id"
>
{{ user.name }}
<li>
</ul>Why should this rule be included
- Style guide has provided some reasons. This rule's priority is essential, which is the same priority as rule vue/valid-v-for
- Because of unknown reason, I found out that if I use
v-ifwithv-for, safari will have some wrong behave. I can bypass it if I follow style guide's suggestion (see link above). Wrong behave in Safari vuepress#678
Metadata
Metadata
Assignees
Labels
No labels