2019-04-04 02:17:42 +00:00
|
|
|
<template>
|
|
|
|
<div class="list">
|
2019-04-04 03:45:45 +00:00
|
|
|
<div v-for="item in items" class="list-item" :key="getKey(item)">
|
|
|
|
<slot name="item" :item="item" />
|
|
|
|
</div>
|
2019-04-04 02:17:42 +00:00
|
|
|
<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: () => []
|
2019-04-04 03:45:45 +00:00
|
|
|
},
|
|
|
|
getKey: {
|
|
|
|
type: Function,
|
|
|
|
default: item => item
|
2019-04-04 02:17:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2019-04-04 03:45:45 +00:00
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2019-04-04 02:17:42 +00:00
|
|
|
.list {
|
2019-04-04 03:45:45 +00:00
|
|
|
&-item {
|
|
|
|
border-bottom: 1px solid;
|
|
|
|
border-bottom-color: $fallback--border;
|
|
|
|
border-bottom-color: var(--border, $fallback--border);
|
|
|
|
}
|
|
|
|
|
2019-04-04 02:17:42 +00:00
|
|
|
&-empty-content {
|
|
|
|
text-align: center;
|
|
|
|
padding: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|