When vue keep-alive cooperates with routing, the content of An is cached when it is used to realize the page of A Murray B, which is displayed later.

how do ue keep-alive cooperate with routing to implement the page of Amurb, cache the content of A, and then display it

keep-alive and beforerouterLeave or beforerouterenter

Mar.02,2021

set under A:

beforeRouteLeave( to, from, next) {
    if(to.name === B) {
        from.meta.keepAlive == true
    }
}

keep-alive automatically records the location and saves the cached content. There is no need to do it deliberately. before , keep-alive is the caching mode, and the cached page content will be saved automatically, but you need to know when you want to figure it out

.
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-1eae7ad-21d7.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-1eae7ad-21d7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?