zamiana infinite scrolla na przyciski

This commit is contained in:
2023-07-02 14:50:18 +02:00
parent 5429d39f5e
commit 10e183d96b
10 changed files with 88 additions and 65 deletions
+4 -2
View File
@@ -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);
},