As we always see, notifications can be show in title, so when I get the unread notifications count form API, I want to show this count in title , like:
(2)page title
But the nuxt title is configured, I didn't find the proper way to set it dynamically.
How can I resolve this?
Hi @bimohxh , you can try this in the top component that shows notifications number.
head () {
return {
titleTemplate: `(${this.$store.notificationNumber}) %s`
}
},
@motia Thanks! this works, just put this to layouts/default.vue
what about the description can we update that dynamically.
Dynamically means on each search meta title and description will update.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@motia Thanks! this works, just put this to
layouts/default.vue