From 90b3fab28ef53135f3cab1f69a4675f98a130857 Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期日, 08 十一月 2020 18:43:05 +0800 Subject: [PATCH] feat: routes with parameters can be cached --- src/layouts/page/index.tsx | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/page/index.tsx b/src/layouts/page/index.tsx index eb3f809..fd31615 100644 --- a/src/layouts/page/index.tsx +++ b/src/layouts/page/index.tsx @@ -44,10 +44,10 @@ // TODO add key? const Content = openCache ? ( <KeepAlive max={max} include={cacheTabs}> - <Component /> + <Component key={route.path} /> </KeepAlive> ) : ( - <Component /> + <Component key={route.path} /> ); return openRouterTransition ? ( <Transition -- Gitblit v1.8.0