pleroma-fe/src/components/list/list.vue
taehoon 1cec2b6969 use reusable List vue component instead of withList hoc
Using slot is the preferred way in vue
2019-04-17 11:32:48 -04:00

29 lines
444 B
Vue

<template>
<div class="list">
<slot name="item" v-for="item in items" :item="item" />
<div class="list-empty-content faint" v-if="items.length === 0">
<slot name="empty" />
</div>
</div>
</template>
<script>
export default {
props: {
items: {
type: Array,
default: () => []
}
}
}
</script>
<style lang="scss">
.list {
&-empty-content {
text-align: center;
padding: 10px;
}
}
</style>