leaf-document-web/src/views/documents/List.vue

57 lines
1.2 KiB
Vue
Raw Normal View History

2023-12-06 02:07:39 +00:00
<template>
2023-12-07 06:58:43 +00:00
<div>{{ documents }}</div>
2023-12-07 07:09:42 +00:00
<div>
<v-row >
<v-col cols="6" md="4">
<v-skeleton-loader
class="mx-auto border"
max-width="300"
type="image, article"
></v-skeleton-loader>
</v-col>
<v-col cols="6" md="4">
<v-skeleton-loader
class="mx-auto border"
max-width="300"
type="image, article"
></v-skeleton-loader>
</v-col>
<v-col cols="6" md="4">
<v-skeleton-loader
class="mx-auto border"
max-width="300"
type="image, article"
></v-skeleton-loader>
</v-col>
</v-row>
</div>
2023-12-06 02:07:39 +00:00
</template>
2023-12-07 06:39:34 +00:00
<script setup>
2023-12-07 07:09:42 +00:00
import { document } from "@/plugins/api";
import router from "@/router";
import { ref } from "vue";
2023-12-07 06:39:34 +00:00
2023-12-07 07:09:42 +00:00
const libraryId = router.currentRoute.value.params.LibraryId;
const page = ref(1);
const documents = ref([]);
const loading = ref(false);
2023-12-07 06:58:43 +00:00
function load() {
2023-12-07 07:09:42 +00:00
loading.value = true;
2023-12-07 06:58:43 +00:00
2023-12-07 07:09:42 +00:00
document
.libraryLibraryIdDocumentsGet(libraryId, page.value)
.then((r) => {
documents.value = r.data;
})
.finally(() => {
loading.value = false;
});
2023-12-07 06:58:43 +00:00
}
2023-12-07 06:39:34 +00:00
2023-12-07 07:09:42 +00:00
load();
console.log(libraryId);
2023-12-07 06:39:34 +00:00
</script>