first version of book form

This commit is contained in:
Artlef
2025-10-26 17:18:58 +01:00
parent a5b16a9522
commit cae46614ba
3 changed files with 14 additions and 3 deletions

View File

@@ -7,7 +7,7 @@
});
let { data, error } = getBook(props.id);
const imagePathOrDefault = "../defaultbook.png"
onBeforeRouteUpdate(async (to, from) => {
let res = getBook(to.params.id);
data = res.data;
@@ -17,8 +17,13 @@
</script>
<template>
<div>
<pre>{{ data }}</pre>
<div v-if="error">{{$t('bookform.error', {error: error.message})}}</div>
<div v-if="data">
<h3 class="title">{{data.title}}</h3>
<h3 class="subtitle">{{data.author}}</h3>
<figure class="image">
<img v-bind:src="imagePathOrDefault" v-bind:alt="data.title">
</figure>
</div>
</template>

View File

@@ -38,5 +38,8 @@
"read": "Read",
"startread": "Start reading",
"wantread": "I want to read it"
},
"bookform": {
"error": "Error when loading book: {error}"
}
}

View File

@@ -38,5 +38,8 @@
"read": "Lu",
"startread": "Commencer la lecture",
"wantread": "Je veux le lire"
},
"bookform": {
"error": "Erreur pendant le chargement du livre: {error}"
}
}