How does vue keepAlive remove the first cache record?

scenario: a home page, B list page, C details page

B---->C      keepAlive:true
A---->C      
B---->C      ()       
A---->C      ,

:
    { path:"notice",meta:{keepAlive:true},title:"",name:"notice",icon:"ios-paper", component: () => import("@/views/production-order/production-notice.vue")},
    { path:"editNotice",meta:{keepAlive:true},title:"",name:"editNotice",icon:"ios-paper", component: () => import("@/views/production-order/edit-notice.vue")}

    <!---->
    <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <!---->
    <router-view v-if="!$route.meta.keepAlive">
    </router-view>
    

production-notice.vue page

beforeRouteEnter(to,from,next){
    //to=   from=>

    //editNotic
    if(from.name === "editNotice"){
        from.meta.keepAlive = true;
        //editNotice
    }else if(from.name !== "editNotice"){
        //""
        from.meta.keepAlive = true;
    };
    next();
},
beforeRouteLeave(to,from,next){
    console.log("",to)
    console.log("",from)
    //
    if(to.name === "editNotice"){
        to.meta.keepAlive = false;
    }else if(to.name !== "editNotice"){
        to.meta.keepAlive = true;
    };
    next();
}

edit-notice.vue page

beforeRouteEnter(to,from,next){
    //notice,,
    if(from.name === "notice"){
        to.meta.keepAlive = false;
        next()
    }else if(from.name !== "notice"){
        //notice,,
        to.meta.keepAlive = true;
        next()
    };
},
beforeRouteLeave(to,from,next){
    if(to.name !== "notice"){
        //
        if(!from.meta.keepAlive){
            from.meta.keepAlive=true;//CB
        }
        next();
    }if(to.name === "notice"){
        //
        from.meta.keepAlive = true;
        next();
    };
}
Jul.01,2021

Hello, landlord! I hope this article will help you Vue site-wide cache keep-alive: dynamically remove cache

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bfa98f-3198e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bfa98f-3198e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?