Hey @paytonmcl!
You can do this using the router, but you’ll have to create a custom navigation guard to handle it (something like this https://alligator.io/vuejs/vue-router-modify-head/)
The other and more simple option is to use the popular vue-meta
package.
- Install it:
npm install vue-meta
- Import and use it in
main.js
:
import VueMeta from 'vue-meta';
Vue.use(VueMeta);
- Update the title in each component:
<script>
export default {
name: 'home',
metaInfo: {
title: "Homepage"
}
}
</script>
Hope that helps!