mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: modifyHistroy改为modifyCreateHistroy,避免执行不必要的创建初始逻辑路由
This commit is contained in:
parent
4c53932ae1
commit
e52b5232ae
@ -1,4 +1,4 @@
|
|||||||
import { createMemoryHistory } from '@@/core/coreExports';
|
import { createMemoryHistory, getHistory } from '@@/core/coreExports';
|
||||||
import qiankunRender, { clientRenderOptsStack, history } from './lifecycles';
|
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) {
|
if (history.url) {
|
||||||
const memoHistroy = createMemoryHistory();
|
return createMemoryHistory
|
||||||
memoHistroy.push(history.url)
|
|
||||||
return memoHistroy
|
|
||||||
}
|
}
|
||||||
return memo;
|
return memo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onRouterCreated({ router }) {
|
export function onRouterCreated({ router }) {
|
||||||
|
if(history.url) {
|
||||||
|
const memoryHistory = getHistory();
|
||||||
|
memoryHistory.push(history.url)
|
||||||
|
}
|
||||||
if(history.onRouterInit){
|
if(history.onRouterInit){
|
||||||
history.onRouterInit(router)
|
history.onRouterInit(router)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user