perf: 触摸返回中禁止滚动消息列表

This commit is contained in:
kuaifan 2022-05-29 12:32:37 +08:00
parent 178b511a24
commit e750d2ae80
3 changed files with 16 additions and 7 deletions

View File

@ -53,7 +53,7 @@
"vue-resize-observer": "^2.0.16",
"vue-router": "^3.5.3",
"vue-template-compiler": "^2.6.14",
"vue-virtual-scroller-hi": "^1.0.10-1",
"vue-virtual-scroller-hi": "^1.0.10-2",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"webpack": "^5.69.1",

View File

@ -1,8 +1,10 @@
<template>
<div class="mobile-back" :style="style"></div>
<div v-if="show" class="mobile-back" :style="style"></div>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "MobileBack",
props: {
@ -37,10 +39,12 @@ export default {
},
computed: {
...mapState(['windowScrollY']),
style() {
return {
top: this.y + 'px',
left: this.x > 20 && this.show ? 0 : '-50px',
top: (this.y + this.windowScrollY) + 'px',
left: this.x > 20 ? 0 : '-50px',
}
},
},

View File

@ -65,10 +65,14 @@
</slot>
<DynamicScroller
ref="scroller"
class="dialog-scroller"
:class="{
'overlay-y': !touchBackInProgress
}"
:disabled="touchBackInProgress"
:items="allMsgs"
:min-item-size="58"
@onScroll="onScroll"
class="dialog-scroller overlay-y">
@onScroll="onScroll">
<template #before>
<template v-if="allMsgs.length === 0">
<div v-if="dialogData.loading > 0" class="dialog-item loading"><Loading/></div>
@ -239,7 +243,8 @@ export default {
'cacheDialogs',
'dialogMsgs',
'wsOpenNum',
'windowScrollY'
'windowScrollY',
'touchBackInProgress'
]),
isReady() {