vue-element-admin icon indicating copy to clipboard operation
vue-element-admin copied to clipboard

deepClone router中asyncRoutes 导致每次点击侧边栏,layout组件都重新渲染

Open yellowfish621 opened this issue 1 year ago • 3 comments

我的项目是从后端传router的key去和前端路由表中asyncRoutes的name做匹配,最后过滤生成新路由表, 所以我修改了store中的generateRoutes方法 使用deepClone(asyncRoutes) image

但是不知为何导致生成的路由每次点击侧边栏,Layout组件都会重新渲染一次 而当我执行logout退出登录,再重新登录后,Layout组件却可以只渲染一次了,令人十分不解

yellowfish621 avatar Sep 26 '24 08:09 yellowfish621