0👍
You may be able to use the IntersectionObserver api to check what rows are visible within the parent table. Add an intersection observer for each row, and use isIntersecting to check whether the row is visible or not.
const rows = document.querySelector('.row')
const rowsObserver = new IntersectionObserver(entries => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
(your code here)
} else {
(your code here)
}
})
})
rowsObserver.observe(rows)
To calculate the first and last visible rows, you might add or remove each row from a "visibleElements" array as their visibility changes, or toggle a "visible" class.
- [Vuejs]-How can I register external component dynamically without any modification of parent(main) Project in vue3?
- [Vuejs]-A List with several Columns in VUE JS projects
Source:stackexchange.com