vue-router + keep-alive 滚动条位置
lw10008 opened this issue · comments
-
版本 4.0.3
-
问题
- 配合vue-router,组件都已经被keep-alive缓存
- 在组件中使用
s-table
并且关闭分页,然后滚动条-滚动一段距离后跳转路由,待再次返回后滚动条重置最顶部了
https://codesandbox.io/s/damp-leftpad-wv5lrf?file=/src/components/home.vue
是这样的,组件本身不会去做这种位置缓存,你可以在业务组件中记录下滚动的位置,下次激活的时候滚动到指定位置