Add drawai qrart pagination (#176)

This commit is contained in:
HCode authored and GitHub committed 2025-02-12 21:52:35 +08:00
1 parent c59c916b99
commit 094b7cd518
14 files changed
+202 -47

No files matched your search

+12 -2
View File
@@ -1,5 +1,5 @@
<template>
<div class="panel recent">
<div ref="panel" class="panel recent" @scroll="onHandleScroll">
<div v-if="tasks?.items === undefined" class="tasks">
<div v-for="_ in 3" :key="_" class="task placeholder">
<div class="left">
@@ -40,6 +40,7 @@ export default defineComponent({
ElSkeleton,
ElSkeletonItem
},
emits: ['reach-top'],
data() {
return {
job: 0
@@ -50,9 +51,18 @@ export default defineComponent({
// reverse the order of the tasks.items
return {
...this.$store.state.qrart?.tasks,
items: this.$store.state.qrart?.tasks?.items?.slice().reverse()
items: this.$store.state.qrart?.tasks?.items?.slice()
};
}
},
methods: {
onHandleScroll() {
const el = this.$refs.panel as HTMLElement;
console.log('reach-top reach-top reach-top');
if (el.scrollTop === 0) {
this.$emit('reach-top');
}
}
}
});
</script>