17. The front end of the route router-07keep-alive

keep-alive component is an abstract Vue provide to cache components, thereby saving performance,

Because it is an abstract component, so after v page rendering is completed will not be rendered into a DOM element

When the switch assembly is activated in the keep-alive component, deactivated two lives

Cycle hook function is executed

 

example:

  h3 label binding event, when clicking the color red

  

 <Keep-alive> saved to the cache tag parcel routing

  

  

Route Object:

  

 

 When switching routed back, then any previously saved state

  

 

Guess you like

Origin www.cnblogs.com/sunny666/p/11114072.html