Skip to content

Commit 19c7285

Browse files
fix: fixed slots inconsistence
1 parent 34ace5d commit 19c7285

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/guide/component-slots.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ app.component('todo-list', {
239239
},
240240
template: `
241241
<ul>
242-
<li v-for="(todo, index) in items" v-bind:key="index">
242+
<li v-for="(item, index) in items">
243243
{{ item }}
244244
</li>
245245
</ul>
@@ -262,7 +262,7 @@ To make `item` available to the slot content provided by the parent, we can add
262262

263263
```html
264264
<ul>
265-
<li v-for="( item, index ) in items" v-bind:key="`${item}-${index}`">
265+
<li v-for="( item, index ) in items">
266266
<slot v-bind:item="item"></slot>
267267
</li>
268268
</ul>
@@ -392,8 +392,10 @@ Similar to `v-on` and `v-bind`, `v-slot` also has a shorthand, replacing everyth
392392
<h1>Here might be a page title</h1>
393393
</template>
394394

395-
<p>A paragraph for the main content.</p>
396-
<p>And another one.</p>
395+
<template #default>
396+
<p>A paragraph for the main content.</p>
397+
<p>And another one.</p>
398+
</template>
397399

398400
<template #footer>
399401
<p>Here's some contact info</p>
@@ -405,6 +407,7 @@ However, just as with other directives, the shorthand is only available when an
405407

406408
```html
407409
<!-- This will trigger a warning -->
410+
408411
<todo-list #="{ item }">
409412
<i class="fas fa-check"></i>
410413
<span class="green">{{ item }}<span>

0 commit comments

Comments
 (0)