0👍
im not completely sure i got you, but if you want to run somthing every time the url changes, vue router navigation guards can help you a lot (in router.beforeEach
or router.afterEach
for example:
router.beforeEach((to, from, next) => {
// everything you right here will get excuted whenever the route changes
})
)
to change the route, you probably know you can use $router.push(options)
more about it here: https://router.vuejs.org/guide/essentials/navigation.html
- [Vuejs]-Vue various product search
- [Vuejs]-Data received from laravel controller not updating to vue variable
Source:stackexchange.com