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';
    }
}

Related questions

0 votes
asked Sep 9, 2023 in VueJS by DavidAnderson
0 votes
asked Sep 12, 2023 in VueJS by AdilsonLima
...