fix: 优化

This commit is contained in:
wanchun 2022-08-08 10:19:57 +08:00
parent f995f351e6
commit e11173f3a9

View File

@ -82,10 +82,10 @@ export default {
const matched = _route.matched; const matched = _route.matched;
const component = matched[matched.length - 1].components.default; const component = matched[matched.length - 1].components.default;
const name = _route.meta?.name ?? _route.name; const name = _route.meta?.name ?? _route.name;
if (name) { if (name && component) {
// name // name
component.name = name;
// namekeep-aliveinclude // namekeep-aliveinclude
component.name = name;
return name; return name;
} }
} }
@ -122,6 +122,7 @@ export default {
}); });
router.afterEach(() => { router.afterEach(() => {
// route
const name = changePageComName(route); const name = changePageComName(route);
// namekeep-aliveinclude // namekeep-aliveinclude
if (!keepAlivePages.value.includes(name)) { if (!keepAlivePages.value.includes(name)) {