Skip to content

Commit aefafd4

Browse files
authored
Update component-slots.md (#792)
Make it clearer that you can pass as many attributes as you need per slot.
1 parent 705fea0 commit aefafd4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/guide/component-slots.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,16 @@ To make `item` available to the slot content provided by the parent, we can add
268268
</ul>
269269
```
270270

271+
You can bind as many attributes to the `slot` as you need:
272+
273+
```html
274+
<ul>
275+
<li v-for="( item, index ) in items">
276+
<slot :item="item" :index="index" :another-attribute="anotherAttribute"></slot>
277+
</li>
278+
</ul>
279+
```
280+
271281
Attributes bound to a `<slot>` element are called **slot props**. Now, in the parent scope, we can use `v-slot` with a value to define a name for the slot props we've been provided:
272282

273283
```html

0 commit comments

Comments
 (0)