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

tagsView中 tab切换刷新问题,如果入参变更需要刷新,反之不需要 #4208

Open
You00 opened this issue Nov 20, 2023 · 4 comments

Comments

@You00
Copy link

You00 commented Nov 20, 2023

问题:tagsView中 tab切换刷新不刷新问题,针对那种有url地址传参的详情页,因为入参不一样,需要重新加载页面(要刷新),但是对于用户只是点击切换tab,这种情况url地址不变入参不变的,是不需要刷新页面的

请问有什么好的实现方案!

@yaowangmx
Copy link

监听路由变化

@You00
Copy link
Author

You00 commented Nov 27, 2023

监听路由变化

监听路由变化,好像只是监听从哪个页面跳转过来(to, from),同一个页面的话是不是得每次都缓存前一次的路由参数,然后对比当前的路由看参数有没有变化?还是有更优雅的实现方案吗?

@yaowangmx
Copy link

监听路由变化

监听路由变化,好像只是监听从哪个页面跳转过来(to, from),同一个页面的话是不是得每次都缓存前一次的路由参数,然后对比当前的路由看参数有没有变化?还是有更优雅的实现方案吗?

watch: {
$route: {
handler(newRoute, oldRoute) {
console.log(newRoute, oldRoute)
},
deep: true,
immediate: true,
},
}
参数变化也能监听到吧,打印一下不就知道了

@BenXi630
Copy link

我是把id当key

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