diff --git a/packages/keep-alive/src/utils/getModelContent.tsx b/packages/keep-alive/src/utils/getModelContent.tsx index d8e079e1..376879c7 100644 --- a/packages/keep-alive/src/utils/getModelContent.tsx +++ b/packages/keep-alive/src/utils/getModelContent.tsx @@ -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; } diff --git a/packages/umi-presets-alita/src/plugins/defaultConfig.ts b/packages/umi-presets-alita/src/plugins/defaultConfig.ts index 0606edde..d987b5ed 100644 --- a/packages/umi-presets-alita/src/plugins/defaultConfig.ts +++ b/packages/umi-presets-alita/src/plugins/defaultConfig.ts @@ -30,6 +30,7 @@ export default (api: IApi) => { /services\//, ], }, + mobile5: false, ...api.userConfig, } as IConfig;