//封装动画
apiIntersectionObserver(items) {
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry, index) => {
console.log(55);
if (entry.isIntersecting) {
// 处理元素可见的逻辑
} else {
// 处理元素不可见的逻辑
}
});
});
this.$nextTick(() => {
const element = this.$el.querySelector(`.footer`);
console.log(this.$refs.footer);
observer.observe(element);
});
}
正文完