Some problems of vue-router keep-alive

< H1 > question 1: when a component inactive, the data in it suddenly becomes null, but after active, the data is restored < / H1 >. Each object in

list contains an object called content

when this component active , this object is

with data.

clipboard.png

inactive null

clipboard.png

inactive ==

2:

== keep-alive

<keep-alive>
    <router-view></router-view>
</keep-alive>

there is no solution to this for the time being.

Dec.26,2021

problem 2 has been solved. Add key to
< router-view: key= "$route.fullPath" > < / router-view >
problem 1 is being explored.

problem 2 is also solved. I get username through routing in UserInfo . It was previously placed in computed , but now it is assigned directly in created , so that the data cache will not disappear.

Menu