Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 多个详情页切换时,只会展示最后一个页面的内容 #1806

Open
Eastboat opened this issue Jul 1, 2024 · 5 comments
Open

Comments

@Eastboat
Copy link

Eastboat commented Jul 1, 2024

          @spring-jtw  可以页面onUpdated的时候重新init

Originally posted by @ilylx in #1040 (comment)

这种场景下,我的项目API控制请求次数,所以当前这个页面设置了keepAlive后,我不init中是不能请求接口的,如何保持每个TagView下对应的页面的缓存状态

@pixelmaxQm
Copy link
Collaborator

keepalive后 需要自己添加 activated 生命周期 把init放这里面

@Eastboat
Copy link
Author

Eastboat commented Jul 4, 2024

keepalive后 需要自己添加 activated 生命周期 把init放这里面

不是,我这个场景不调用init, 我只是渲染页面,比如 一个详情页,我开了n个tab栏数量,但是此时切换不生效🚨

@Eastboat Eastboat closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@Eastboat Eastboat closed this as completed Jul 4, 2024
@Eastboat Eastboat reopened this Jul 4, 2024
@Eastboat
Copy link
Author

Eastboat commented Jul 4, 2024

我看了下源码,tags那块是通过map去对比url参数,但是主区域content里面的 keep-alive始终只加载一个页面,点击tags切换是不会来回渲染的

@pixelmaxQm
Copy link
Collaborator

vue组件没有变化不会调用生命周期,这种情况下需要监听路由主动调用生命周期。

@ilylx
Copy link

ilylx commented Aug 24, 2024

我看新版已经解决这问题了。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants