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

如何再次刷新页面 #836

Closed
moonose opened this issue Jul 4, 2018 · 5 comments
Closed

如何再次刷新页面 #836

moonose opened this issue Jul 4, 2018 · 5 comments
Labels

Comments

@moonose
Copy link

moonose commented Jul 4, 2018

我用了 this.$router.push(router) 想再次刷新页面,但没有效果。
该如何解决?

@PanJiaChen
Copy link
Owner

vuejs/vue-router#296

的确可以加一个这个reload的功能。

@Fan-City
Copy link

Fan-City commented Jul 8, 2018

vue在route不发生变化的时候,是不会重载画面的吧,试试location.reload()可行么?

@PanJiaChen
Copy link
Owner

@GreatAuk
Copy link

https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/redirect/index.vue

新增了 redirect页面。

请问下用this.$router.replace({ path: this.$route.path, query: { t: Date.now()}}) 和重定向这两个方案有什么区别吗。

@PanJiaChen
Copy link
Owner

你这个等于每个页面后面都会跟一个时间戳,如果不介意也可以,相关内容文档里有介绍。

https://panjiachen.github.io/vue-element-admin-site/zh/guide/essentials/router-and-nav.html#%E7%82%B9%E5%87%BB%E4%BE%A7%E8%BE%B9%E6%A0%8F-%E5%88%B7%E6%96%B0%E5%BD%93%E5%89%8D%E8%B7%AF%E7%94%B1

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

No branches or pull requests

4 participants