@umijs/route-utils
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -155,2 +155,4 @@ import isEqual from 'fast-deep-equal/es6/index'; | ||
item.routes = item.children; | ||
// eslint-disable-next-line no-param-reassign | ||
delete item.children; | ||
} | ||
@@ -167,3 +169,3 @@ const path = mergePath(item.path, parent ? parent.path : '/'); | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
pro_layout_parentKeys = [], routes, icon, flatMenu, indexRoute, ...restParent } = parent; | ||
pro_layout_parentKeys = [], routes, children, icon, flatMenu, indexRoute, ...restParent } = parent; | ||
const finallyItem = { | ||
@@ -222,3 +224,3 @@ ...restParent, | ||
// 兼容一下使用了 children 的旧版,有空删除一下 | ||
if (newItem.children) { | ||
if (newItem.children && !newItem.routes) { | ||
newItem.routes = item.children; | ||
@@ -225,0 +227,0 @@ } |
@@ -246,3 +246,5 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
// eslint-disable-next-line no-param-reassign | ||
item.routes = item.children; | ||
item.routes = item.children; // eslint-disable-next-line no-param-reassign | ||
delete item.children; | ||
} | ||
@@ -263,6 +265,7 @@ | ||
routes = parent.routes, | ||
children = parent.children, | ||
icon = parent.icon, | ||
flatMenu = parent.flatMenu, | ||
indexRoute = parent.indexRoute, | ||
restParent = _objectWithoutProperties(parent, ["pro_layout_parentKeys", "routes", "icon", "flatMenu", "indexRoute"]); | ||
restParent = _objectWithoutProperties(parent, ["pro_layout_parentKeys", "routes", "children", "icon", "flatMenu", "indexRoute"]); | ||
@@ -322,3 +325,3 @@ var finallyItem = _objectSpread(_objectSpread(_objectSpread({}, restParent), {}, { | ||
if (newItem.children) { | ||
if (newItem.children && !newItem.routes) { | ||
newItem.routes = item.children; | ||
@@ -325,0 +328,0 @@ } |
@@ -267,3 +267,5 @@ "use strict"; | ||
// eslint-disable-next-line no-param-reassign | ||
item.routes = item.children; | ||
item.routes = item.children; // eslint-disable-next-line no-param-reassign | ||
delete item.children; | ||
} | ||
@@ -284,6 +286,7 @@ | ||
routes = parent.routes, | ||
children = parent.children, | ||
icon = parent.icon, | ||
flatMenu = parent.flatMenu, | ||
indexRoute = parent.indexRoute, | ||
restParent = _objectWithoutProperties(parent, ["pro_layout_parentKeys", "routes", "icon", "flatMenu", "indexRoute"]); | ||
restParent = _objectWithoutProperties(parent, ["pro_layout_parentKeys", "routes", "children", "icon", "flatMenu", "indexRoute"]); | ||
@@ -343,3 +346,3 @@ var finallyItem = _objectSpread(_objectSpread(_objectSpread({}, restParent), {}, { | ||
if (newItem.children) { | ||
if (newItem.children && !newItem.routes) { | ||
newItem.routes = item.children; | ||
@@ -346,0 +349,0 @@ } |
{ | ||
"name": "@umijs/route-utils", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Quickly process the routing of umi", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120436
2303