Manage display of book covers

This commit is contained in:
2025-10-28 18:35:36 +01:00
parent 8b8eee8210
commit b4df375e4c
20 changed files with 257 additions and 353 deletions

View File

@@ -1,16 +1,18 @@
<script setup>
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { getImagePathOrDefault } from './api.js'
const props = defineProps({
id: Number,
title: String,
author: String,
imagePath: String,
coverPath: String,
rating: Number,
read: Boolean
});
const imagePathOrDefault = (props.imagePath == "" || typeof props.imagePath === 'undefined') ? "defaultbook.png" : props.imagePath;
const router = useRouter();
const imagePathOrDefault = computed(() => getImagePathOrDefault(props.coverPath));
const router = useRouter();
function openBook() {
router.push(`/book/${props.id}`)