UNPKG

gxd-vue-library

Version:

依赖与element Ui插件库,聚福宝福利PC端插件库

26 lines (24 loc) 787 B
'use strict'; export function keepAliveMultipleLevelCache(to, router ) { if (to.matched && to.matched.length > 2) { to.matched.map((v, k) => { if (v.components.default instanceof Function) { // 区分非懒路由 if (v.components.default.length === 0) { v.components.default().then((components) => { if (components.default.name === 'JfbChildren') { to.matched.splice(k, 1); //router.push({path: to.path, query: to.query}); keepAliveMultipleLevelCache(to, router); } }); } } else { if (v.components.default.name === 'JfbChildren') { to.matched.splice(k, 1); keepAliveMultipleLevelCache(to, router); } } }); } }