Skip to content

Commit

Permalink
fix: dropByCacheKey
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Mar 28, 2022
1 parent 1dcfa6f commit a1b27a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/keep-alive/src/utils/getModelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ let LayoutInstance: LayoutInstanceProps;
function dropByCacheKey(pathname: string) {
if (LayoutInstance) {
const { alivePathnames, keepAliveViewMap } = LayoutInstance;
const index = alivePathnames.findIndex(item => item === pathname);
const index = alivePathnames.findIndex(item => item === pathname?.toLowerCase());
if (index !== -1) {
alivePathnames.splice(index, 1);
// 用来当作key,只有key发生变化才会remout组件
for (const key in keepAliveViewMap) {
if (pathToRegexp(key).test(pathname)) {
if (pathToRegexp(key).test(pathname?.toLowerCase())) {
keepAliveViewMap[key].recreateTimes += 1;
break;
}
Expand Down
1 change: 1 addition & 0 deletions packages/umi-presets-alita/src/plugins/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default (api: IApi) => {
/services\//,
],
},
mobile5: false,
...api.userConfig,
} as IConfig;

Expand Down

0 comments on commit a1b27a3

Please sign in to comment.