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-resize-observer": "^2.0.16",
"vue-router": "^3.5.3", "vue-router": "^3.5.3",
"vue-template-compiler": "^2.6.14", "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", "vuedraggable": "^2.24.3",
"vuex": "^3.6.2", "vuex": "^3.6.2",
"webpack": "^5.69.1", "webpack": "^5.69.1",

View File

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

View File

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