Manage display of book covers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user