From 9641b0dc677a8c39b423c0b16e5cb5512a3090b6 Mon Sep 17 00:00:00 2001 From: wanchun <445436867@qq.com> Date: Tue, 28 Mar 2023 21:04:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(built-in):=20=E9=81=BF=E5=85=8D=E5=9C=A8bef?= =?UTF-8?q?oreRender=20action=E4=B8=AD=E6=93=8D=E4=BD=9C=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=88=96=E8=80=85location.href=EF=BC=8C=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E5=87=BA=E7=8E=B0=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/route/template/routeExports.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fes-preset-built-in/src/plugins/route/template/routeExports.tpl b/packages/fes-preset-built-in/src/plugins/route/template/routeExports.tpl index 504f7ef9..d32f294a 100644 --- a/packages/fes-preset-built-in/src/plugins/route/template/routeExports.tpl +++ b/packages/fes-preset-built-in/src/plugins/route/template/routeExports.tpl @@ -66,7 +66,10 @@ export const createRouter = (routes) => { document.body.removeChild(rootElement); } } - next(); + // 避免在beforeRender action中操作路由或者location.href,构建后会出现卡死 + setTimeout(() => { + next(); + }, 0); }) plugin.applyPlugins({