first version of book form
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user