fix: modifyHistroy改为modifyCreateHistroy,避免执行不必要的创建初始逻辑路由

This commit is contained in:
harrywan 2021-05-31 17:03:09 +08:00
parent 4c53932ae1
commit e52b5232ae

View File

@ -1,4 +1,4 @@
import { createMemoryHistory } from '@@/core/coreExports';
import { createMemoryHistory, getHistory } from '@@/core/coreExports';
import qiankunRender, { clientRenderOptsStack, history } from './lifecycles';
@ -14,16 +14,18 @@ export function modifyClientRenderOpts(memo) {
};
}
export function modifyHistroy(memo) {
export function modifyCreateHistroy(memo) {
if (history.url) {
const memoHistroy = createMemoryHistory();
memoHistroy.push(history.url)
return memoHistroy
return createMemoryHistory
}
return memo;
}
export function onRouterCreated({ router }) {
if(history.url) {
const memoryHistory = getHistory();
memoryHistory.push(history.url)
}
if(history.onRouterInit){
history.onRouterInit(router)
}