在页面上操做后,地址的 query
execute_status 须要变化,在代码中使用 this.$router.push()
以后,页面没有刷新,脚本没有执行。html
两个地址使用的是同一个组件,比起销毁原组件后建立新组件,复用组件的效率更高,因此页面上没有更新。vue
监听路由$route
变化react
watch: { '$route' (to, from) { // 对路由变化做出响应... } }
利用路由的钩子函数:beforeRouteUpdate
ide
beforeRouteUpdate (to, from, next) { // react to route changes... // don't forget to call next() }