Vue-router: 怎么刷新当前页面

Created on 27 Oct 2015  ·  3Comments  ·  Source: vuejs/vue-router

@yyx990803 ,你好,我想刷新当前页面,请问怎么操作呢?
当前房屋的链接是:http://localhost:9090/order-detail/1270,我想通过按钮触发刷新当前页面。
我目前用的下面的代码不起作用

that.$route.router.go({
        name:'order-detail',
        params:{orderId:that.order.id}//此处id为1270.
});

Most helpful comment

@shinygang 我赞成你说的刷新,类似backbone的路由,提供的reload函数
@NemoAlex 有些实时性比较强的应用是需要重置当前路由区域的,location.reload()会整个刷新的额,满足不了需求

All 3 comments

按照此类应用的理念,没有刷新页面一说。数据和界面是绑定的关系。如果需要改变界面状态,操纵数据即可。
非要刷新的话,location.reload(); 吧。

@shinygang 我赞成你说的刷新,类似backbone的路由,提供的reload函数
@NemoAlex 有些实时性比较强的应用是需要重置当前路由区域的,location.reload()会整个刷新的额,满足不了需求

怎么实现刷新当前页面呢,对于单页面应用

Was this page helpful?
0 / 5 - 0 ratings