Skip to content

Commit

Permalink
Update App.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
journey-ad committed Dec 19, 2023
1 parent de6225d commit 63e267b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<script>
import Preload from "@/components/Preload";
import { mapState, mapActions } from "vuex";
export default {
name: "App",
Expand All @@ -20,7 +21,11 @@ export default {
isTopShow: false,
};
},
computed: {
...mapState(["SETTING"]),
},
methods: {
...mapActions(["saveSETTING"]),
toTop() {
document.documentElement.scrollTo({ top: 0, behavior: "smooth" });
},
Expand All @@ -32,6 +37,16 @@ export default {
}
},
},
beforeMount() {
const { r18 } = this.$route.query;
if (+r18 === 1) {
this.saveSETTING({
...this.SETTING,
r18: true,
});
}
},
mounted() {
window.addEventListener("scroll", this.scrollHandler);
},
Expand Down

0 comments on commit 63e267b

Please sign in to comment.