-
-
Notifications
You must be signed in to change notification settings - Fork 5k
同一个地址只变化id,页面不重载,怎么解决?? #469
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
Comments
data 钩子会被再次触发,可以在data()中进行处理。 #296 |
问题已经解决啦。使用的canReuse |
canReuse不优雅 因为会重新渲染整个组件 建议使用data |
@fnlctrl 我在data钩子里请求数据,在浏览器地址栏更改params,data会重新请求,但是视图却并没有更新,不知道问题在什么地方 |
好了,整体改了一下,改成 http://vuejs.github.io/vue-router/en/pipeline/data.html 就好了, 感谢 @fnlctrl |
Hi vue 2.0 如何解决这个问题? 另外上面的 vue-router的参考信息现在都链接不过去. |
同上,vue2.0怎么解决这个问题,我试着用$router.go()去跳转路由,但是会刷新整个页面而不是路由组件部分,谢谢! |
在vue单页面中项目开发中遇到一个问题,侧边栏有一个列表,点击列表选项会跳转动态路由刷新右边的页面。当第一次点击侧边列表的时候,页面动态路由会正常跳转,而跳转后再次点击其他列表项,动态路由中的id会发生相应的变化,但页面不会刷新,依然保持在第一次点击列表项进入的某个页面。 出现这种情况是因为依赖路由的params参数获取写在created生命周期里面,因为相同路由二次甚至多次加载的关系 没有达到监听,退出页面再进入另一个文章页面并不会运行created组件生命周期,导致文章数据还是第一次进入的数据。解决办法是: 作者:苏泞 |
以上所有文章的链接都打不开了😓 |
Locking as this is issue is really outdated now |
比如我有一个路由是
/content/:id
,当我冲/content/123
跳转到/content/456
的时候,页面不会重载,这个问题怎么解决???@yyx990803
The text was updated successfully, but these errors were encountered: