This commit is contained in:
李志鹏
2026-05-15 17:32:55 +08:00
12 changed files with 914 additions and 143 deletions

View File

@@ -33,7 +33,7 @@ export default {
rootMap.set(obj.root, [obj])
obj.root.addEventListener('scroll', handleScroll)
},
beforeUnmount(el: HTMLElement, binding: any) {
beforeUnmount(el: HTMLElement) {
rootMap.forEach((objs, root) => {
if (objs.some((v: any) => v.el === el)) {
objs = objs.filter((v_: any) => v_.el !== el)
@@ -60,4 +60,4 @@ function handleScroll(e: any) {
obj.el.classList.toggle('active', isActive)
}
})
};
};

View File

@@ -2,7 +2,7 @@ import { gsap, } from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
export default {
name: 'tween-animation',
mounted(el: HTMLElement, binding: any) {
mounted(el: HTMLElement) {
// if(!binding.value.isGsap)return
let dom = document.querySelector('body')
gsap.registerPlugin(ScrollTrigger);
@@ -26,4 +26,4 @@ export default {
// }
});
},
};
};