mirror of
https://github.com/kuaifan/dootask.git
synced 2026-04-02 10:40:08 +00:00
解决消息滚动出现白屏的情况
This commit is contained in:
parent
17c9a8b3fa
commit
9ea250278d
@ -90,8 +90,7 @@
|
|||||||
@on-emoji="onEmoji">
|
@on-emoji="onEmoji">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<div v-if="(allMsgs.length === 0 && dialogData.loading > 0) || nextPage > 0" class="dialog-item loading"><Loading/></div>
|
<div v-if="(allMsgs.length === 0 && dialogData.loading > 0) || nextPage > 0" class="dialog-item loading"><Loading/></div>
|
||||||
<div v-else-if="allMsgs.length > 0" class="dialog-item loaded">{{$L('已加载全部消息')}}</div>
|
<div v-else-if="allMsgs.length === 0" class="dialog-item nothing">{{$L('暂无消息')}}</div>
|
||||||
<div v-else class="dialog-item nothing">{{$L('暂无消息')}}</div>
|
|
||||||
</template>
|
</template>
|
||||||
</VirtualList>
|
</VirtualList>
|
||||||
|
|
||||||
@ -839,7 +838,15 @@ export default {
|
|||||||
const previousSize = typeof previousValue === "object" ? previousValue.size : scroller.getSize(previousValue)
|
const previousSize = typeof previousValue === "object" ? previousValue.size : scroller.getSize(previousValue)
|
||||||
return {size: previousSize + scroller.getSize(currentId)}
|
return {size: previousSize + scroller.getSize(currentId)}
|
||||||
})
|
})
|
||||||
scroller.scrollToOffset(offset.size);
|
let size = this.$refs.scroller.getOffset() + offset.size;
|
||||||
|
if (this.nextPage === 0) {
|
||||||
|
size -= 36
|
||||||
|
}
|
||||||
|
scroller.scrollToOffset(size);
|
||||||
|
setTimeout(_ => {
|
||||||
|
// 预防出现白屏的情况
|
||||||
|
scroller.scrollToOffset(size);
|
||||||
|
}, 1)
|
||||||
});
|
});
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -672,10 +672,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.loading,
|
&.loading {
|
||||||
&.loaded {
|
|
||||||
color: rgba($primary-desc-color, 0.6);
|
|
||||||
font-size: 13px;
|
|
||||||
height: 20px;
|
height: 20px;
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user