vue中keep-alive多级路由缓存问题
2022-04-16 12:53:47 来源:易采站长站 作者:
目录
1.问题描述2.原因分析3.解决思路4.处理过程1.问题描述st.length <= 0) return routesList; let list = []; routesList.forEach(v => { if(v.path === '/') { // 用于添加初试layout和首页,其他各中心配置过滤掉layout及父节点,只保留children内路由 list.push(v); list = list.concat(formatFlatteningRoutes(v.children)) } else if (v.children && v.children.length > 0) { list = list.concat(formatFlatteningRoutes(v.children)) } else { list.push(v); } }) return list;})export const formatTwoStageRoutes = list => { if (list.length <= 0) return list; const routerList = []; list.forEach(v => { if (v.path =SVXGtdfFK== '/') { routerList.push({ component: v.component, name: v.name, path: v.path, redirect: v.redirect, meta: v.meta, children: [] }) } else if (v.path === '/login' || v.path === '/showcasePage') { // 不需要配置layout的页面 routerList.push(v) } else { routerList[0].chilSVXGtdfFKdren.push({ ...v }) } }) return routerList;}
暂时禁止评论













闽公网安备 35020302000061号