async doTasksListBefore() {
console.log(this.tasksList)
if (this.tasksList.length) {
// #ifndef APP-NVUE
if (currentScrollTop < 1 ) {
console.log('小于1111',currentScrollTop);
this.scrollTop = currentScrollTop
return this.$nextTick(async() => {
console.log('等待滚动晚渲染')
this.scrollTop = 1
currentScrollTop = 1
await this.doTasksList()
})
}
// #endif
await this.doTasksList()
}
}
做聊天室,做加载聊天历史记录的时候,把uniIm的代码抄了过来,但是currentScrollTop被赋值之后一直0,导致一直不断的执行加载历史记录,在我想来,这个doTasksListBefore执行完之后currentScrollTop应该会变成上一页最后一条的位置,但是怎么找都找不到相关的问题
h***@protonmail.com (作者)
实现了,但只是针对h5,那在ios上如果不适用nvue cell keep-scroll-position有什么方案可以替代的吗,想要最快上线,nvue还得改一大堆
2023-11-20 15:37
h***@protonmail.com (作者)
或者,我现在用另外一套unilist使用rotate 旋转180deg的方案来做,这个可以解决加载历史记录闪动的问题,但是这个因为使用uni.pageScrollTo ,导致在软键盘弹起的时候,uniPageScrollto没法滚动到最底部,有啥办法吗,项目急上线,跪求个回复拜谢了
2023-11-20 15:41
h***@protonmail.com (作者)
https://ask.dcloud.net.cn/question/116194 类似于这个问题,还望看一下
2023-11-20 15:51
3***@qq.com
回复 DCloud_uniCloud_JSON: 官方有发现一个很明显的bug的么,在列表数据中定时器往数组list unshift 数据,会出现dom节点渲染问题并显示undefined
2024-08-09 10:53
3***@qq.com
回复 3***@qq.com:push的形式是没问题的,unshift才会有问题,只能往后加数据,不能往前,或者 需要把 v-for 中的key换成index 才能正常显示
2024-08-09 10:55
DCloud_uniCloud_JSON
回复 3***@qq.com: 聊天消息列表,不想用 nvue 的话可以翻转 list,参考最新版的 uni-im
2024-08-09 11:15