The Vue.js Master Class 2024 Edition
Plans from $25/month

This lesson is for members. Join us?

Subscribe now and get immediate access to this course, 30 more and all future Vue.js courses!

Use the Vue Watch API to Update Pinia Store with the Project Name

🚧 PLEASE NOTE: This masterclass is built with the Options API
vuejs-masterclass

The Composition API Masterclass is coming soon!

Every page should have a title, and when it was just a static title, that was easy. But for our individual project pages, the title needs to be dynamic, based on the project name we get from the database. To handle that, we’ll take advantage of Vue's reactivity system and use the watch API to keep an eye on the project data and update the Pinia store with the correct project name. This way, the title always matches the current project, no matter what!

Links