quasar里Loading plugin造成scrollBehavior的行为不正确

发现线上的项目页面scrollBehavior表现不正常。从Index点击route到detail页面,再后退,回到的位置是detail页面的scroll position,而不是route前index页面的scroll position。后来到以前的分支查看,发现是在ssr改造后出现的问题。一开始以为是quasar.conf.js 的preFetch: true开关的问题。把开关关闭就好了,后来发现是在DetailPage的preFetch hook中使用了Loading plugin的关系。后来查到有人也遇到这个问题。改成Loading只在server端使用。

https://forum.quasar-framework.org/topic/5934/scroll-behaviour-when-using-prefetch-ssr/3

I noticed they are using preventScroll in the Loading.js file and this is apparently the bug source, when I removed it to test, the scrolling worked as expected

posted @   zjhgx  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示