$router.go({
path: $router.path,
query: {
t: + new Date()
}
})
When you change routes the standard Vue Options / Lifecycle Hooks won't work. You need to use Vue-Routers hooks:
Vue.component('hook-example', {
// ... other options
route: {
activate: function () {
console.log('hook-example activated!')
},
canDeactivate: function (transition) {
console.log('You are not allowed to leave.')
transition.abort()
}
}
})