<templete>
<div class="recruitsubstance" ref="recruitDashboardScreen">
内容
</div>
</templete>
mounted() {
this.observeElement()
},
data() {
return {
tableDataHeight: 0,
}
},
methods: {
observeElement() {
const recruitScreen = document.querySelector('.recruitsubstance');
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const elementHeight = entry.target.offsetHeight;
this.tableDataHeight =elementHeight
} else {
console.log('Element is out of view');
}
});
});
observer.observe(recruitScreen);
},
}
11-26
09-19