mirror of
https://github.com/romancm/gamebrary
synced 2024-11-14 23:47:08 +00:00
Updte page title
This commit is contained in:
parent
d35ce02eb7
commit
4a26dc0802
4 changed files with 20 additions and 1 deletions
|
@ -44,6 +44,10 @@ router.beforeEach((to, from, next) => {
|
|||
if (to.meta.requiresAuth && !store.getters.auth) {
|
||||
next('/');
|
||||
} else {
|
||||
if (to.meta && to.meta.title) {
|
||||
document.title = `${to.meta.title} - Gamebrary`;
|
||||
}
|
||||
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -86,6 +86,8 @@ export default {
|
|||
|
||||
mounted() {
|
||||
this.loadGameData();
|
||||
|
||||
document.title = `${this.platform.name} - Gamebrary`;
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -60,11 +60,12 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['game', 'settings']),
|
||||
...mapState(['game', 'settings', 'platform']),
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.commit('SET_ACTIVE_GAME', this.$route.params.id);
|
||||
document.title = `${this.platform.name} - ${this.game.name} - Gamebrary`;
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
|
|
|
@ -15,6 +15,9 @@ export default new Router({
|
|||
path: '/share/:id',
|
||||
name: 'share',
|
||||
component: ShareList,
|
||||
meta: {
|
||||
title: 'Public list',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'game-detail',
|
||||
|
@ -25,16 +28,25 @@ export default new Router({
|
|||
name: 'platforms',
|
||||
path: '/platforms',
|
||||
component: Platforms,
|
||||
meta: {
|
||||
title: 'Platforms',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'settings',
|
||||
path: '/settings',
|
||||
component: Settings,
|
||||
meta: {
|
||||
title: 'Settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/session-expired',
|
||||
name: 'sessionExpired',
|
||||
component: SessionExpired,
|
||||
meta: {
|
||||
title: 'Session expired',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
|
|
Loading…
Reference in a new issue