perf: route rank is null

This commit is contained in:
xiaoxian521 2022-03-17 19:53:19 +08:00
parent 8a926c509f
commit 12c2365a26

View File

@ -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");