ice-lab / icestark

:tiger: Micro Frontends solution for large application(面向大型应用的微前端解决方案),站点国内镜像:https://icestark.gitee.io
https://micro-frontends.ice.work
MIT License
2.04k stars 174 forks source link

子路由点击菜单整个菜单树刷新 #686

Open CrownHanhard opened 1 year ago

CrownHanhard commented 1 year ago

主应用和子应用都是vite 菜单为动态菜单 点击子应用的菜单会出现重新渲染菜单

ClarkXia commented 1 year ago

https://github.com/ice-lab/react-materials/blob/master/scaffolds/icestark-layout/src/layouts/FrameworkLayout/index.tsx#L12

路由变化会导致整个 FrameworkLayout 发生渲染的,如果部分菜单不希望重新渲染可以通过 useMemo 等逻辑定向优化下

CrownHanhard commented 1 year ago

我们是Vue3的 目前发现了问题 是在start里面监听了路由改变防止路由不跳转加了一个router push 把这段注释掉就可以了