Comments (9)
版本为1.3.1, 项目是h5页面.
from react-router-cache-route.
能否尝试检查除了滚动距离外,其他的列表数据是否被缓存了?
例如已经请求的列表数据、或者检查列表页组件生命周期是否从头开始了
需要先排除 列表页与详情页共用了 body 作为滚动容器导致滚动位置被重置
的问题
from react-router-cache-route.
能否尝试检查除了滚动距离外,其他的列表数据是否被缓存了?
例如已经请求的列表数据,或者检查列表页组件生命周期是否从头开始了
先需要排除
列表页与详情页共用了 body 作为滚动容器导致滚动位置被重置
的问题
列表页确实跟详情页共用了body滚动容器,但是没办法的事情呀,我们的列表要求吸顶还有置顶按钮,用window来操作
from react-router-cache-route.
仔细观察到,商品详情第一次返回到列表的话是可以cache滚动条的,之后又不行了,这是啥子原因,ios很烦
from react-router-cache-route.
你们的需求应该也可以通过自建滚动容器来实现
目前来说 CacheRoute
无法处理共用滚动容器的情况,目前在和 react-keep-alive 作者讨论 saveScrollTop
函数功能,如果得以支持可以考虑一下这个方案
后续 CacheRoute
也会尝试支持此方案,不过时间待定,目前比较忙
saveScrollTop
行为的运作方式大致为:
在组件被缓存时将所有订阅了 saveScrollTop
需求的滚动容器 scrollTop 记住,并于组件恢复时恢复各订阅容器的 scrollTop,这个功能理论上将可作用于共用滚动容器的情况
from react-router-cache-route.
CacheRoute
你们的需求应该也可以通过自建滚动容器来实现
来说目前
CacheRoute
无法处理共用滚动容器的情况,目前在和反应,保活作者讨论saveScrollTop
函数功能,如果得以支持可以考虑一下这个方案后续
CacheRoute
也会尝试请立即获取iTunes此方案,不过时间待定,目前比较忙
saveScrollTop
行为的运作方式大致为:在组件被缓存时将所有订阅了
saveScrollTop
需求的滚动容器scrollTop记住,并于组件恢复时恢复各订阅容器的scrollTop,这个功能理论上将可作用于共用滚动容器的情况
现在已经解决了,用div滚动,但问题是每个页面都这样的话导致很重复
from react-router-cache-route.
@huanzheke 可以尝试在离开列表页时,保存滚动值;返回到列表页时触发生命周期,然后在激活这个生命周期中重新设置滚动值。
from react-router-cache-route.
@huanzheke 可以尝试在离开列表页时,保存滚动值;返回到列表页时触发生命周期,然后在激活这个生命周期中重新设置滚动值。
谢谢大佬,不怎么好单独维护,还是用一个容器让他自生自灭吧.
from react-router-cache-route.
新发布 v1.8.0
尝试解决共用容器问题,为 CacheRoute
增加 saveScrollPosition
属性可实现此功能
from react-router-cache-route.
Related Issues (20)
- 带参数详情页面多份数据缓存如何做? HOT 4
- 带有参数的页面,离开页面的时候useParams会返回undefined,导致无法维持原来的页面组件状态 HOT 3
- 请问下作者如何处理跳转路径完全相同,但是state不同的情况 HOT 2
- 路由里存在中文,路由会缓存2份
- 开启multiple后,带querystring的路由缓存失败
- 请问 在cache-route中如何实现仅在切换路由列表时卸载当前页面组件 谢谢 HOT 1
- `CacheSwitch` re-mount the same component if path changes HOT 1
- item/detail/:id 这种带参数的路由缓存不了,
- 在路由back后,怎么让缓存的组件不重新render呢? HOT 1
- 怎么实现头部Tabs页签的效果?能否提供一些示例? HOT 1
- How to turn off the display:none of the component HOT 5
- 使用CacheRoute缓存路由,出现闪烁
- 【咨询】为什么 Updatable 内部的 Freeze 需要 Delay 1s HOT 2
- CacheSwitch不会触发Suspense的fallback HOT 3
- iframe嵌套状态保留
- 打包部署后报错 HOT 3
- react18+ 安装该库提示报错,最终安装失败
- 切换路由时原页面与悬浮相关的内容都会重新悬浮一遍 HOT 1
- README链接失效 HOT 1
- Uncaught TypeError: Super expression must either be null or a function, not undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-router-cache-route.