hedera-web/src/components/ui/CardList.vue

59 lines
1.2 KiB
Vue

<script setup>
const props = defineProps({
clickable: { type: Boolean, default: true },
rounded: { type: Boolean, default: true }
});
const emit = defineEmits(['click']);
const handleClick = () => {
if (props.clickable) {
emit('click');
}
};
</script>
<template>
<QItem
v-bind="$attrs"
v-ripple="clickable"
:clickable="clickable"
class="full-width row items-center justify-between card no-border-radius bg-white"
:class="{ 'cursor-pointer': clickable, 'no-radius': !rounded }"
@click="handleClick()"
>
<div class="no-padding content-container col-10">
<slot name="prepend" />
<div class="content">
<slot name="content" />
</div>
</div>
<div class="no-padding flex full-width justify-center">
<slot name="actions" />
</div>
</QItem>
</template>
<style lang="scss" scoped>
.card {
border-bottom: 1px solid $gray-light;
padding: 20px;
}
.content {
display: flex;
flex-direction: column;
overflow: hidden;
* {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.content-container {
display: flex;
}
</style>