Skip to content

Commit fc6b292

Browse files
zdsfwysdras
authored andcommitted
to reduce misleading, add a note for [v-for with v-if] section (#2029)
* to reduce misleading, add a note for [v-for with v-if] section * move note to the top of the target section
1 parent 3119f1d commit fc6b292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/v2/guide/list.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ Similar to template `v-if`, you can also use a `<template>` tag with `v-for` to
441441

442442
## `v-for` with `v-if`
443443

444+
<p class="tip">Note that it's **not** recommended to use `v-if` and `v-for` together. Refer to [style guide](/v2/style-guide/#Avoid-v-if-with-v-for-essential) for details.</p>
445+
444446
When they exist on the same node, `v-for` has a higher priority than `v-if`. That means the `v-if` will be run on each iteration of the loop separately. This can be useful when you want to render nodes for only _some_ items, like below:
445447

446448
``` html

0 commit comments

Comments
 (0)