refactor(menu): 外链/内嵌改为 type=E+component 统一判断
@@ -179,7 +179,7 @@ export default defineMock([
|
||||
children: [
|
||||
{
|
||||
path: "apifox",
|
||||
component: null,
|
||||
component: "iframe",
|
||||
name: "Apifox",
|
||||
meta: {
|
||||
title: "Apifox",
|
||||
@@ -225,7 +225,6 @@ export default defineMock([
|
||||
},
|
||||
{
|
||||
path: "https://juejin.cn/post/7228990409909108793",
|
||||
name: "ext-30",
|
||||
meta: {
|
||||
title: "平台文档(外链)",
|
||||
type: "E",
|
||||
|
||||
|
Before Width: | Height: | Size: 487 KiB After Width: | Height: | Size: 504 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 609 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 115 KiB |
@@ -775,17 +775,18 @@ function normalizeMenuPayload(): MenuForm {
|
||||
}
|
||||
|
||||
if (payload.type === MenuTypeEnum.EXTERNAL) {
|
||||
payload.component = undefined;
|
||||
payload.perm = undefined;
|
||||
payload.redirect = undefined;
|
||||
payload.alwaysShow = undefined;
|
||||
payload.params = [];
|
||||
|
||||
if (!payload.component) {
|
||||
// 新标签页:不需要路由名称、路径、缓存
|
||||
payload.routeName = undefined;
|
||||
payload.routePath = undefined;
|
||||
payload.keepAlive = undefined;
|
||||
} else if (!isStatusEnabled(payload.keepAlive)) {
|
||||
// 内嵌但未开启缓存:不需要路由名称
|
||||
payload.routeName = undefined;
|
||||
}
|
||||
}
|
||||
|
||||