Add pagination for booksearch

This commit is contained in:
2025-11-11 00:32:00 +01:00
parent 87f6daef18
commit 6b2038aeec
10 changed files with 185 additions and 50 deletions

View File

@@ -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) {