Add pika hailuo pagination (#173)
This commit is contained in:
1 parent
14efcf4e55
commit
d8fba2afd8
16 files changed
+172
-33
No files matched your search
@@ -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.pika?.tasks,
|
||||
items: this.$store.state.pika?.tasks?.items?.slice().reverse()
|
||||
items: this.$store.state.pika?.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>
|
||||
|
||||
@@ -137,7 +137,6 @@ export default defineComponent({
|
||||
result.push(audio);
|
||||
});
|
||||
}
|
||||
console.log('videos', result);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user