lesson 110: add named slots
This commit is contained in:
parent
69e590ea13
commit
2aead5518b
|
@ -1,15 +1,18 @@
|
|||
<template>
|
||||
<section>
|
||||
<base-card>
|
||||
<h2>Available Badges</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<base-badge type="admin" caption="ADMIN"></base-badge>
|
||||
</li>
|
||||
<li>
|
||||
<base-badge type="author" caption="AUTHOR"></base-badge>
|
||||
</li>
|
||||
</ul>
|
||||
<template v-slot:header> <h2>Available Badges</h2> </template>
|
||||
|
||||
<template v-slot:default>
|
||||
<ul>
|
||||
<li>
|
||||
<base-badge type="admin" caption="ADMIN"></base-badge>
|
||||
</li>
|
||||
<li>
|
||||
<base-badge type="author" caption="AUTHOR"></base-badge>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</base-card>
|
||||
</section>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<template>
|
||||
<div><slot></slot></div>
|
||||
<div>
|
||||
<header>
|
||||
<slot name="header"></slot>
|
||||
</header>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
<template>
|
||||
<section>
|
||||
<base-card>
|
||||
<h3>{{ fullName }}</h3>
|
||||
<base-badge :type="role" :caption="role.toUpperCase()"></base-badge>
|
||||
<p>{{ infoText }}</p>
|
||||
<template v-slot:header>
|
||||
<h3>{{ fullName }}</h3>
|
||||
<base-badge
|
||||
:type="role"
|
||||
:caption="role.toUpperCase()"
|
||||
></base-badge>
|
||||
</template>
|
||||
|
||||
<template v-slot:default>
|
||||
<p>{{ infoText }}</p>
|
||||
</template>
|
||||
</base-card>
|
||||
</section>
|
||||
</template>
|
||||
|
|
Reference in New Issue