Skip to content

Commit 367d0b6

Browse files
committed
update v-if/v-else example to with new rootless syntax
1 parent 73e2aab commit 367d0b6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/guide/render-function.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,10 @@ Vue.component('anchored-heading', {
214214
Wherever something can be easily accomplished in plain JavaScript, Vue render functions do not provide a propriety alternative. For example, in a template using `v-if` and `v-for`:
215215

216216
``` html
217-
<div>
218-
<ul v-if="items.length">
219-
<li v-for="item in items">{{ item.name }}</li>
220-
</ul>
221-
<p v-else>No items found.</p>
222-
</div>
217+
<ul v-if="items.length">
218+
<li v-for="item in items">{{ item.name }}</li>
219+
</ul>
220+
<p v-else>No items found.</p>
223221
```
224222

225223
This could be rewritten with JavaScript's `if-else` and `map` in a render function:

0 commit comments

Comments
 (0)