it is known that there is a page A, and this page has multiple pages that can be routed to jump over, such as: the BMagne C ~ (?) D page. Page A has a click event goIndex to return to the previous page. How to process and judge in page A that when the returned page is B, set the $route.meta.keepAlive of page B to true?
A page code as follows:
//
goIndex(){
this.$router.go(-1);
}
because the B page also has multiple entries, it may be returned from the A page, or it may be routed from the H page. Therefore, it cannot be set to meta: {keepAlive: true} directly in the index.js of the route.
so, how to set the keepAlive of the route to page B to true when page B is returned on page A?