在頁面上操做後,地址的 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() }