Hotfixy; dodano przyciski powrotu do dla wszystkich widoków

This commit is contained in:
2022-05-28 01:03:51 +02:00
parent 9345697d07
commit 0b5b0f5178
7 changed files with 54 additions and 9 deletions
+31
View File
@@ -0,0 +1,31 @@
import { defineComponent, h } from "vue";
export default defineComponent({
data() {
return {
icons: {
arrow: require('@/assets/icon-arrow-asc.svg'),
},
showReturnButton: false
}
},
methods: {
scrollToTop() {
window.scrollTo({ top: 0 });
},
handleScroll() {
this.showReturnButton = window.scrollY > window.innerHeight;
}
},
activated() {
window.addEventListener('scroll', this.handleScroll);
},
deactivated() {
window.removeEventListener('scroll', this.handleScroll);
},
})