add border-bottom style to the list component as well

This commit is contained in:
taehoon 2019-04-03 23:45:45 -04:00
parent 80d83b46d9
commit d806038ad3

View file

@ -1,6 +1,8 @@
<template> <template>
<div class="list"> <div class="list">
<slot name="item" v-for="item in items" :item="item" /> <div v-for="item in items" class="list-item" :key="getKey(item)">
<slot name="item" :item="item" />
</div>
<div class="list-empty-content faint" v-if="items.length === 0"> <div class="list-empty-content faint" v-if="items.length === 0">
<slot name="empty" /> <slot name="empty" />
</div> </div>
@ -13,13 +15,26 @@ export default {
items: { items: {
type: Array, type: Array,
default: () => [] default: () => []
},
getKey: {
type: Function,
default: item => item
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss';
.list { .list {
&-item {
display: flex;
border-bottom: 1px solid;
border-bottom-color: $fallback--border;
border-bottom-color: var(--border, $fallback--border);
}
&-empty-content { &-empty-content {
text-align: center; text-align: center;
padding: 10px; padding: 10px;