2021-10-31 21:31:03 +01:00
|
|
|
<template>
|
|
|
|
<div ref="container" @mouseover="mouseover" @mouseleave="mouseleave" class="relative">
|
2021-11-07 02:31:46 +01:00
|
|
|
<covers-book-cover :width="24" :audiobook="audiobook" />
|
2021-10-31 21:31:03 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
audiobook: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isHovering: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
placeholderUrl() {
|
|
|
|
return '/book_placeholder.jpg'
|
|
|
|
},
|
|
|
|
fullCoverUrl() {
|
2022-03-11 01:45:02 +01:00
|
|
|
return this.$store.getters['audiobooks/getLibraryItemCoverSrc'](this.audiobook, this.placeholderUrl)
|
2021-10-31 21:31:03 +01:00
|
|
|
},
|
|
|
|
hasCover() {
|
|
|
|
return !!this.audiobook.book.cover
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
mouseover() {
|
|
|
|
this.isHovering = true
|
|
|
|
},
|
|
|
|
mouseleave() {
|
|
|
|
this.isHovering = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|