@umijs/route-utils
Quickly process the routing of umi

@umijs/route-utils downloads @umijs/route-utils version @umijs/route-utils license

@umijs/route-utils유사 패키지:
npm 다운로드 트렌드
3 년
🌟 @umijs/route-utils의 README.md에 실시간 사용 차트를 표시하려면 아래 코드를 복사하세요.
## Usage Trend
[![Usage Trend of @umijs/route-utils](https://npm-compare.com/img/npm-trend/THREE_YEARS/@umijs/route-utils.png)](https://npm-compare.com/@umijs/route-utils#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 @umijs/route-utils의 README.md에 GitHub Stars 트렌드 차트를 표시하려면 아래 코드를 복사하세요.
## GitHub Stars Trend
[![GitHub Stars Trend of @umijs/route-utils](https://npm-compare.com/img/github-trend/@umijs/route-utils.png)](https://npm-compare.com/@umijs/route-utils)
통계 세부사항
패키지
다운로드
Stars
크기
Issues
발행일
라이선스
@umijs/route-utils201,91043148 kB416日前MIT
@umijs/route-utils의 README

npm package

@umijs/route-utils

Usage

# npm
npm i @umijs/route-utils --save

## yarn
yarn add @umijs/route-utils

API

import { transformRoute, getMatchMenu } from '@umijs/route-utils';

const routes = [
  {
    path: '/welcome',
    name: 'welcome',
  },
  {
    path: '/admin',
    name: 'admin',
    access: 'canAdmin',
  },
  {
    name: 'list.table-list',
    path: '/list',
  },
];

const { menuData, breadcrumb } = transformRoute(routes);

console.log(menuData[0].name); // welcome

console.log(breadcrumb.get('/welcome').name); // welcome

MenuDataItem

import { MenuDataItem } from '@umijs/route-utils';

export interface MenuDataItem {
  routes?: MenuDataItem[];
  hideChildrenInMenu?: boolean;
  hideInMenu?: boolean;
  icon?: React.ReactNode;
  locale?: string | false;
  name?: string;
  key?: string;
  pro_layout_parentKeys?: string[];
  path?: string;
  [key: string]: any;
}

LICENSE

MIT