
I have noticed in quite a few projects that developers forget to keep page title updated with the router or maybe think that they will do it tomorr...
For further actions, you may consider blocking this person and/or reporting abuse
Updating the title is definetly something a lot of spa's seems to neglect.
In your example you should probably specify immediate:true for the watch, otherwise the title wont update on the first load
And if you start adding more metadata I would recommend looking at github.com/nuxt/vue-meta
Navigation guard inside your router makes more sense structurally IMO, but each work well:
;)
Another way is using
router.afterEach
Hello, here is a version with the composition API:
I'm wondering why you have Step 2 with the title "Add $route watcher in your App.vue" but then the tutorial text instructs us to put the watcher in main.vue. Could you please clarify this.
By main vue file I meant the file that contains the router view inside it. Some template generators that I used would name it App.vue :)
Thanks so Much.
Thanks so much!