0 votes
in VueJS by
How do you watch route object changes?

1 Answer

0 votes
by

You can setup a watcher on the $route in your component. It observes for route changes and when changed ,sets the message property.

watch:{
    $route (to, from){
        this.message = 'Welcome';
    }
}
...