first version of book form
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let { data, error } = getBook(props.id);
|
let { data, error } = getBook(props.id);
|
||||||
|
const imagePathOrDefault = "../defaultbook.png"
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
let res = getBook(to.params.id);
|
let res = getBook(to.params.id);
|
||||||
data = res.data;
|
data = res.data;
|
||||||
@@ -17,8 +17,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="error">{{$t('bookform.error', {error: error.message})}}</div>
|
||||||
<pre>{{ data }}</pre>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -38,5 +38,8 @@
|
|||||||
"read": "Read",
|
"read": "Read",
|
||||||
"startread": "Start reading",
|
"startread": "Start reading",
|
||||||
"wantread": "I want to read it"
|
"wantread": "I want to read it"
|
||||||
|
},
|
||||||
|
"bookform": {
|
||||||
|
"error": "Error when loading book: {error}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,8 @@
|
|||||||
"read": "Lu",
|
"read": "Lu",
|
||||||
"startread": "Commencer la lecture",
|
"startread": "Commencer la lecture",
|
||||||
"wantread": "Je veux le lire"
|
"wantread": "Je veux le lire"
|
||||||
|
},
|
||||||
|
"bookform": {
|
||||||
|
"error": "Erreur pendant le chargement du livre: {error}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user