About vue in the cache of the page

vue keep-alive is a component built-in, so that components can be included that is on hold, or to avoid re-rendered.

usage:

 

Adding keep-alive inside label

include: string or a regular expression. Only matching components are cached

exclude:  a string or a regular expression. Any matching components will not be cached.

 

 

Combined router buffer part of the page:

 

More practical examples:

 

Ideas: by beforeRouterLeave to assign routing inside keepAlive this hook. A dynamically determining whether a page to be cached.

 

Guess you like

Origin www.cnblogs.com/ysx215/p/11414093.html