mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
zamiana infinite scrolla na przyciski
This commit is contained in:
@@ -9,8 +9,10 @@ export default defineComponent({
|
||||
methods: {
|
||||
mountObserver(actionFunction: () => void, target: Element) {
|
||||
this.observer = new IntersectionObserver((entries) => {
|
||||
if (entries[0].intersectionRatio > 0) actionFunction();
|
||||
});
|
||||
console.log(entries);
|
||||
|
||||
if (entries[0].intersectionRatio > 0.5) actionFunction();
|
||||
}, { threshold: 0.2 });
|
||||
|
||||
this.observer.observe(target);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user