show empty slot only if it has content

This commit is contained in:
taehoon 2019-04-04 03:03:47 -04:00
parent b8ec13c8fd
commit f066ccd28b

View File

@ -3,7 +3,7 @@
<div v-for="item in items" class="list-item" :key="getKey(item)">
<slot name="item" :item="item" :keyVal="getKey(item)" />
</div>
<div class="list-empty-content faint" v-if="items.length === 0">
<div class="list-empty-content faint" v-if="items.length === 0 && !!$slots.empty">
<slot name="empty" />
</div>
</div>