yandere_fe/src/components/selectable_list/selectable_list.vue

23 lines
539 B
Vue
Raw Normal View History

2019-04-03 18:43:24 -07:00
<template>
<div class="selectable-list">
2019-04-03 20:29:24 -07:00
<div v-for="item in items" :key="getKey(item)">
2019-04-03 20:26:13 -07:00
<Checkbox :checked="isChecked(item)" @change="checked => toggle(checked, item)" />
<slot name="item" :item="item" />
</div>
<div class="selectable-list-empty-content faint" v-if="items.length === 0">
<slot name="empty" />
</div>
2019-04-03 18:43:24 -07:00
</div>
</template>
<script src="./selectable_list.js"></script>
2019-04-03 18:43:24 -07:00
<style lang="scss">
.selectable-list {
&-empty-content {
text-align: center;
padding: 10px;
}
}
2019-04-03 18:43:24 -07:00
</style>