From 12c2365a262c570ee7ad1a40cff86bb9da7c47e0 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 17 Mar 2022 19:53:19 +0800 Subject: [PATCH] perf: route rank is null --- src/router/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/router/utils.ts b/src/router/utils.ts index 8c418d9..9ad5ffd 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -23,6 +23,7 @@ import { getAsyncRoutes } from "/@/api/routes"; // 按照路由中meta下的rank等级升序来排序路由 function ascending(arr: any[]) { arr.forEach(v => { + if (v?.meta?.rank === null) v.meta.rank = undefined; if (v?.meta?.rank === 0) { if (v.name !== "home" && v.path !== "/") { console.warn("rank only the home page can be 0");