diff --git a/src/utils/utils.js b/src/utils/utils.js index 37b6eca68beed83ed848e615f8547657033f4d79..9700b31e98a2347b4bead287995edfe1bfe238d1 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -123,11 +123,10 @@ function getRenderArr(routes) { let renderArr = []; renderArr.push(routes[0]); for (let i = 1; i < routes.length; i += 1) { - let isAdd = false; - // 是否包含 - isAdd = renderArr.every(item => getRelation(item, routes[i]) === 3); // 去重 renderArr = renderArr.filter(item => getRelation(item, routes[i]) !== 1); + // 是否包含 + const isAdd = renderArr.every(item => getRelation(item, routes[i]) === 3); if (isAdd) { renderArr.push(routes[i]); }