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,5 +1,6 @@
<script setup>
import { getBook } from './api.js'
import { computed } from 'vue'
import { getBook, getImagePathOrDefault } from './api.js'
import { onBeforeRouteUpdate } from 'vue-router'
const props = defineProps({
@@ -7,7 +8,7 @@
});
let { data, error } = getBook(props.id);
const imagePathOrDefault = "../defaultbook.png"
const imagePathOrDefault = computed(() => getImagePathOrDefault(data.value.coverPath));
onBeforeRouteUpdate(async (to, from) => {
let res = getBook(to.params.id);
data = res.data;