I am using Vuetify predefined Template 'Google Contacts'.
Link: https://vuetifyjs.com/en/examples/layouts/googleContacts
I am new in Vuetify and facing difficulties understanding some codes. One is 'slot activator'.
Sample Code:
<v-list-tile slot="activator">
<v-list-tile-content>
<v-list-tile-title>
{{ item.text }}
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
Can anybody tell me how 'slot activator' works?
When you declare a Vue component, you can create Named Slots, which is a Vue native feature (not from Vuetify):
Notice the
<slot name="header"></slot>
in the example template declaration (first code block above). When someone uses that component, she can declare<h1 slot="header">Here might be a page title</h1>
and this code will take<slot name="header"></slot>
's place in the final markup.Here's a demo of the
<slot>
s in action:Your code
You show the example:
As you can see, this code tries to place the
v-list-tile
in theactivator
slot of the parent component (v-list-group
).Having a look at the official docs (incl. the old version), there's no mention if the
<v-list-group>
has a slot namedactivator
.But a look at
<v-list-group>
's SOURCE CODE quickly proves there does exist one.