komga/komga-webui/src/components/ReadMore.vue
Gauthier Roebroeck 9071ad59ef fix(webui): truncate summary and authors when too long
summary can be expanded by clicking a 'read more' button
authors are truncated with an ellipsis, full text will show on hover
reorder summary and authors for browse book view
2021-01-11 22:28:58 +08:00

30 lines
670 B
Vue

<template>
<vue-read-more-smooth no-shadow :lines="4">
<div class="text-body-1"
style="white-space: pre-wrap"
>
<slot/>
</div>
<template v-slot:more="value">
<v-btn text small color="grey darken-1">
{{ value.open ? 'Read less' : 'Read more' }}
<v-icon right>mdi-chevron-{{ value.open ? 'up' : 'down' }}</v-icon>
</v-btn>
</template>
</vue-read-more-smooth>
</template>
<script lang="ts">
// @ts-ignore
import VueReadMoreSmooth from "vue-read-more-smooth"
import Vue from 'vue'
export default Vue.extend({
name: 'ReadMore',
components: { VueReadMoreSmooth },
})
</script>
<style scoped>
</style>