<keep-alive include="Home"> //include等于组件名 如需缓存多个组件,:include="['News','Home']" <router-view />
</keep-alive>
缓存路由组件,让不显示的组件保持挂载,不被销毁
路由组件独特的生命周期函数
activated(){ //路由组件被激活时触发 } deactivated() { //路由组件被失活时触发 },