Skip to content

Commit 51c04a8

Browse files
committed
change title
1 parent 4f9e2ae commit 51c04a8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

web/src/components/PlayerList.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default {
5858
computed: mapState([
5959
'playerList',
6060
'scrollOffset',
61+
'info',
6162
]),
6263
methods: {
6364
...mapMutations([
@@ -110,6 +111,11 @@ export default {
110111
}
111112
});
112113
},
114+
beforeRouteEnter(to, from, next) {
115+
next((vm) => {
116+
document.title = vm.info.title;
117+
});
118+
},
113119
components: {
114120
playerblock: PlayerBlock,
115121
nyaaFooter: Footer,

web/src/components/PlayerPage.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<script>
4949
import axios from 'axios';
50-
import { mapMutations } from 'vuex';
50+
import { mapMutations, mapState } from 'vuex';
5151
5252
import { store } from '../main';
5353
import NameHistory from './NameHistory';
@@ -98,12 +98,16 @@ export default {
9898
uuid,
9999
player: data,
100100
});
101+
document.title = `${this.info.title} - ${this.player.data.playername}`;
101102
},
102103
setInfoData(data) {
103104
this.mutableInfo = data;
104105
},
105106
},
106107
computed: {
108+
...mapState([
109+
'info',
110+
]),
107111
isCanvasSupported() {
108112
const elem = document.createElement('canvas');
109113
return !!(elem.getContext && elem.getContext('2d'));
@@ -118,8 +122,6 @@ export default {
118122
}, 100);
119123
this.$el.scrollTop = 0;
120124
},
121-
updated() {
122-
},
123125
components: {
124126
NameHistory,
125127
Membership,

0 commit comments

Comments
 (0)