Vue keepalive

is it normal for me to execute the create mounted function in an again when I use keepalive on page a to jump from a to page b?

I listened in a for the scroll event of window to execute activated when it came back from page b, but the scroll bar has no cache is a messy location (is it because other pages have changed window scroll)

I used the scroll bar in the a page container to roll back the page from the b page to the top container instead. The scroll bar is not cached

what exactly is cached by keepalive in vue

Sep.18,2021

caches data, but not the position of the scroll bar. You need to record the position of the scroll bar before jumping, and when you jump back, manually scroll to the previously recorded position

Menu