mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
fix bug
This commit is contained in:
@@ -36,7 +36,6 @@ function startSSEMessager() {
|
|||||||
messages.value.push(object)
|
messages.value.push(object)
|
||||||
emit('scroll')
|
emit('scroll')
|
||||||
}
|
}
|
||||||
isLoaded.value = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -64,12 +63,14 @@ async function loadMessages({ done }: { done: any }) {
|
|||||||
if (currData.value.length > 0) {
|
if (currData.value.length > 0) {
|
||||||
// 合并数据
|
// 合并数据
|
||||||
messages.value = [...currData.value, ...messages.value]
|
messages.value = [...currData.value, ...messages.value]
|
||||||
// 页码+1
|
|
||||||
page.value++
|
|
||||||
// 加载完成
|
// 加载完成
|
||||||
done('ok')
|
done('ok')
|
||||||
// 滚动到底部
|
if (page.value === 1) {
|
||||||
emit('scroll')
|
// 滚动到底部
|
||||||
|
emit('scroll')
|
||||||
|
}
|
||||||
|
// 页码+1
|
||||||
|
page.value++
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
done('ok')
|
done('ok')
|
||||||
@@ -127,18 +128,7 @@ onMounted(() => {
|
|||||||
</VRow>
|
</VRow>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!isLoaded"
|
v-if="messages.length === 0 && isLoaded && !loading"
|
||||||
class="mt-5 w-full text-center flex flex-col items-center"
|
|
||||||
>
|
|
||||||
<VProgressCircular
|
|
||||||
size="48"
|
|
||||||
indeterminate
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
<span class="mt-3">正在刷新 ...</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="messages.length === 0 && isLoaded"
|
|
||||||
class="w-full text-center flex flex-col items-center"
|
class="w-full text-center flex flex-col items-center"
|
||||||
>
|
>
|
||||||
<span class="mb-3">当前没有消息</span>
|
<span class="mb-3">当前没有消息</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user