vue-scroller icon indicating copy to clipboard operation
vue-scroller copied to clipboard

使用keep-alive,离开页面再次进入, 上次的滚动位置丢失。

Open dingly opened this issue 7 years ago • 6 comments

在源码中查看有一个计时器一直监控当前窗口的变化会实时resize(), 但是这样每次离开页面之后再回来就无法回到上次浏览位置, 如果在deactivated的时候记录下浏览位置,再次进入时再滚动到记录的浏览位置, 可以回到历史浏览位置, 但是这个滚动过程中, 用户能看到这个滚动的过程, 虽然时间很短, 还是有一个滚动的动作, 用户交互不好, 请问可以优化下或者有更好的解决方案吗? 求解

dingly avatar Jul 04 '17 01:07 dingly

同问,会闪下,体验很不好

hjm201 avatar Jul 05 '17 02:07 hjm201

Scroller.vue line number :344

      let flag = this.content.offsetHeight && this.container.clientHeight // 宽高不为0
      flag = flag && (top + 60 > this.content.offsetHeight - this.container.clientHeight )
      if (flag) {
        if (this.loadingState) return
        this.loadingState = 1
        this.showLoading = true
        this.onInfinite(this.finishInfinite)
      }

Scroller.vue line number :383

    let flag = width !== content_width || height !== content_height
    flag = flag && width && height // 宽高不为0
    if (flag) {
      content_width = width
      content_height = height
      this.resize()
    }

liuzhenghui avatar Aug 09 '17 07:08 liuzhenghui

同问。这个问题解决了吗~~~~~

greedying avatar Oct 12 '17 11:10 greedying

同问,keep-alive不记录位置,手动scrollTo会存在从上到下的过程,闪屏体验不好。。。有解决方案吗

c870275682 avatar Dec 18 '17 04:12 c870275682

去掉boolean这个参数的设置,就没有闪退了

jojo-1995 avatar Sep 24 '19 06:09 jojo-1995

同问

wbxyy avatar Mar 13 '20 08:03 wbxyy