Vue clears the pits encountered by the cache keepalive

encountered the same Bug, link as the landlord: https://www.cnblogs.com/nokel..

but the last piece of code is a little hard to understand, and I don"t know where to add it. Do you know how to solve it?

Aug.27,2021

this method reloadInterceptor is added to the global guard afterEach () in router.


there are great disadvantages in using this solution. When you enter the same page for the second time, the vnode in the cache is not clear, which will lead to the inability to create new vue instances and will not normally follow the life cycle such as created. It is safer to use keep-alive-helper to solve your problems.

Menu