Skip to content

Commit ef8d59e

Browse files
committed
fix scroll bug
1 parent 51c04a8 commit ef8d59e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

web/src/components/PlayerList.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default {
3535
searchTimer: null,
3636
loading: true,
3737
timer: null,
38+
isScrolled: false,
3839
};
3940
},
4041
async mounted() {
@@ -98,8 +99,8 @@ export default {
9899
next();
99100
},
100101
updated() {
101-
this.$nextTick(function () {
102-
if (this.scrollOffset.length === 32) {
102+
this.$nextTick(() => {
103+
if (this.scrollOffset.length === 32 && !this.isScrolled) {
103104
setTimeout(() => {
104105
VueScrollTo.scrollTo(`[data-uuid="${this.scrollOffset}"]`, 500, {
105106
duration: 500,
@@ -109,6 +110,7 @@ export default {
109110
});
110111
}, 100);
111112
}
113+
this.isScrolled = true;
112114
});
113115
},
114116
beforeRouteEnter(to, from, next) {

web/src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const store = new Vuex.Store({
3232
players: {},
3333
playerList: [],
3434
scrollOffset: '',
35+
keyword: '',
3536
},
3637
mutations: {
3738
setInfo(state, payload) {

0 commit comments

Comments
 (0)