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