Skip to content

Commit 0d6da5e

Browse files
committed
feat: scroll top before chaging view
1 parent e72e0c0 commit 0d6da5e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/store/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ const store = new Vuex.Store<State>({
5353
stage(state, stage) {
5454
if (state.stage.name === stage.name) return;
5555

56+
window.scrollTo({
57+
behavior: 'smooth',
58+
top: 0
59+
});
60+
5661
state.stage.transition = stage.transition || 'forwards';
5762
state.stage.name = stage.name;
5863
window.history.pushState(stage, document.title);

0 commit comments

Comments
 (0)