Add pagination for booksearch
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { ref, computed } from 'vue'
|
||||
import { getBook, getImagePathOrDefault, putReadBook, putWantReadBook, putRateBook } from './api.js'
|
||||
import { onBeforeRouteUpdate } from 'vue-router'
|
||||
import { VRating } from 'vuetify/components/VRating';
|
||||
@@ -9,12 +10,12 @@
|
||||
id: String
|
||||
});
|
||||
|
||||
let { data, error } = getBook(props.id);
|
||||
let data = ref(null);
|
||||
let error = ref(null);
|
||||
getBook(data, error, props.id);
|
||||
const imagePathOrDefault = computed(() => getImagePathOrDefault(data.value.coverPath));
|
||||
onBeforeRouteUpdate(async (to, from) => {
|
||||
let res = getBook(to.params.id);
|
||||
data = res.data;
|
||||
error = res.error;
|
||||
getBook(data, error, to.params.id);
|
||||
})
|
||||
|
||||
function onRatingUpdate(rating) {
|
||||
|
||||
Reference in New Issue
Block a user