Vue caches pages through keep-alive, with questions about the use of beforeRouteEnter

 <keep-alive :include="componentName">
              <router-view></router-view>
            </keep-alive>
 componentName: ["memberList", "storeSettlement","OpenCardAdd"]
beforeRouteEnter (from, to, next) {
      next(vm => {
        //  
        if (to.path.includes("/MarketingManage/Coupon/AddCoupon")){
        }
      });
    },

requires you to cache the entire page when you jump from OpenCardAdd to AddCoupon and then jump back from addcoupor to OpenCardAdd to load the previously saved page
how should beforeRouteEnter write

Mar.02,2021

or who has another way to write


if it's just caching OpenCardAdd, it's already in the include list, it's already cached

.
Menu