The vue keepalive page is not cached. Mounted and activated hooks are called every time you enter the page.

the requirement is that the page will not be refreshed every time you enter the page, such as content, but the page will be refreshed regardless of whether it is switching routes or moving forward and backward.
routing configuration:

mode:"history",
  routes: [
  {
      path: "/",
      redirect:"/content",
      component: home,
      children:[
  // hashcontent
  {path:"/about", name:"about", component:about,meta:{keepAlive:true}},
  {path:"/archives",name:"archives",component:archives,meta:{keepAlive:true}},
  {path:"/content",name:"content",component:content,meta:{keepAlive:true}},
  {path:"/article:_id",name:"article",component:article,meta:{keepAlive:true}}//namename
  ]

},
root component
< div id= "app" >

    <!-- APPvue -->
    <loading v-show="isloading"></loading>
        <router-view></router-view>
</div>

home components

Mar.13,2021

the name property of your setting component is not set in the route, but can only be set in the component

.
Menu