I have a table where 100 records. When I scroll down the table (let's say 50 records), let's say that I leave that page and come back. Then I have to scroll down again from the start. I want the start where I left off. I'm using VueJS. And right now I'm able to get the scroll location using the below code segment
This is my table,
<tbody v-scroll:#scroll-target="updateScrolledPoint">
<tr>
<td>{{book.keyword}}</td>
<td>{{book.avgPages ? book.avgPages : '-'}}</td>
<td>{{book.avgPages ? book.avgPages : '-'}}</td>
<td>{{book.noCompetitors}}</td>
</tr>
</tbody>
This is my function to get the scroll location and store it my custom cache,
updateScrolledPoint(e) {
// Getting the scroll location
const scrollPosition = e.target.scrollTop;
// Setting the scrolled location to the cache
const { activeTab } = this.$props.state.keywordSearch;
cachedHelper.updateCacheScrollLocation(cachedHelper.SCREEN_TYPE.keywordSearch, activeTab, scrollPosition);
}
I want to set the already stored scroll position to scroll the page when I load it again. I believe it's a matter of setting the value in the table please help me.