From 7beb3e63fe7198a93b2f916aa4d9badaef6886e3 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 17 Mar 2022 19:53:10 +0800 Subject: [PATCH] perf: route rank is null --- package.json | 2 +- pnpm-lock.yaml | 2 +- src/router/utils.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9055a4c72..e68a1ecd0 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "mockjs": "^1.1.0", "nprogress": "^0.2.0", "path": "^0.12.7", - "pinia": "^2.0.11", + "pinia": "^2.0.12", "qs": "^6.10.1", "resize-observer-polyfill": "^1.5.1", "responsive-storage": "^1.0.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7deecab3d..2cb6b0f80 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,7 +59,7 @@ specifiers: nprogress: ^0.2.0 path: ^0.12.7 picocolors: ^1.0.0 - pinia: ^2.0.11 + pinia: ^2.0.12 postcss: ^8.4.6 postcss-html: ^1.3.0 postcss-import: 14.0.0 diff --git a/src/router/utils.ts b/src/router/utils.ts index 8c418d9a1..9ad5ffdca 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");