mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
35 lines
627 B
TypeScript
35 lines
627 B
TypeScript
import { defineComponent, h } from 'vue';
|
|
import imageMixin from './imageMixin';
|
|
|
|
export default defineComponent({
|
|
mixins: [imageMixin],
|
|
|
|
data() {
|
|
return {
|
|
icons: {
|
|
arrow: this.getIcon('arrow-asc'),
|
|
},
|
|
|
|
showReturnButton: false,
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
scrollToTop() {
|
|
window.scrollTo({ top: 0 });
|
|
},
|
|
|
|
handleScroll() {
|
|
this.showReturnButton = window.scrollY > window.innerHeight * 0.35;
|
|
},
|
|
},
|
|
|
|
activated() {
|
|
window.addEventListener('scroll', this.handleScroll);
|
|
},
|
|
|
|
deactivated() {
|
|
window.removeEventListener('scroll', this.handleScroll);
|
|
},
|
|
});
|