From e52b5232aebbf25f67760df3fae12e25874201dc Mon Sep 17 00:00:00 2001 From: harrywan Date: Mon, 31 May 2021 17:03:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20modifyHistroy=E6=94=B9=E4=B8=BAmodifyCre?= =?UTF-8?q?ateHistroy,=E9=81=BF=E5=85=8D=E6=89=A7=E8=A1=8C=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=88=9B=E5=BB=BA=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fes-plugin-qiankun/src/micro/runtime/runtime.tpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl index d8e62d47..d0597a4f 100644 --- a/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl +++ b/packages/fes-plugin-qiankun/src/micro/runtime/runtime.tpl @@ -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) }