mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 12:39:59 +01:00
Improve scroll performance
This commit is contained in:
parent
7821386fe2
commit
30913bebbb
@ -74,7 +74,7 @@ export default Vue.extend({
|
||||
|
||||
mounted() {
|
||||
document.addEventListener('visibilitychange', this.onVisibilitychange, false);
|
||||
window.addEventListener('scroll', this.onScroll);
|
||||
window.addEventListener('scroll', this.onScroll, { passive: true });
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
|
@ -51,7 +51,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$refs.body.addEventListener('scroll', this.onScroll);
|
||||
this.$refs.body.addEventListener('scroll', this.onScroll, { passive: true });
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$refs.body.removeEventListener('scroll', this.onScroll);
|
||||
|
@ -46,7 +46,7 @@ export default Vue.extend({
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('keydown', this.onDocumentKeydown);
|
||||
window.addEventListener('scroll', this.onScroll);
|
||||
window.addEventListener('scroll', this.onScroll, { passive: true });
|
||||
|
||||
this.fetch();
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ export default Vue.extend({
|
||||
mounted() {
|
||||
if (this.user.bannerUrl) {
|
||||
window.addEventListener('load', this.onScroll);
|
||||
window.addEventListener('scroll', this.onScroll);
|
||||
window.addEventListener('scroll', this.onScroll, { passive: true });
|
||||
window.addEventListener('resize', this.onScroll);
|
||||
}
|
||||
},
|
||||
|
@ -81,7 +81,7 @@ export default Vue.extend({
|
||||
|
||||
mounted() {
|
||||
document.addEventListener('visibilitychange', this.onVisibilitychange, false);
|
||||
window.addEventListener('scroll', this.onScroll);
|
||||
window.addEventListener('scroll', this.onScroll, { passive: true });
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
|
Loading…
Reference in New Issue
Block a user