@umijs/route-utils
Quickly process the routing of umi
Last updated 3 years ago by chenshuai2144 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @umijs/route-utils 
SYNC missed versions from official npm registry.

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

Current Tags

  • 4.0.1                                ...           latest (2 years ago)

55 Versions

  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 2.2.2                                ...           2 years ago
  • 2.2.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.5                                ...           2 years ago
  • 2.1.4                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.5                                ...           3 years ago
  • 2.0.4                                ...           3 years ago
  • 2.0.3                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.37                                ...           4 years ago
  • 1.0.36                                ...           4 years ago
  • 1.0.35                                ...           4 years ago
  • 1.0.34                                ...           4 years ago
  • 1.0.33                                ...           4 years ago
  • 1.0.32                                ...           4 years ago
  • 1.0.31                                ...           4 years ago
  • 1.0.30                                ...           4 years ago
  • 1.0.29                                ...           4 years ago
  • 1.0.28                                ...           4 years ago
  • 1.0.27                                ...           4 years ago
  • 1.0.26                                ...           4 years ago
  • 1.0.25                                ...           4 years ago
  • 1.0.24                                ...           4 years ago
  • 1.0.23                                ...           4 years ago
  • 1.0.22                                ...           4 years ago
  • 1.0.21                                ...           4 years ago
  • 1.0.20                                ...           4 years ago
  • 1.0.19                                ...           4 years ago
  • 1.0.18                                ...           4 years ago
  • 1.0.17                                ...           4 years ago
  • 1.0.16                                ...           5 years ago
  • 1.0.15                                ...           5 years ago
  • 1.0.14                                ...           5 years ago
  • 1.0.13                                ...           5 years ago
  • 1.0.12                                ...           5 years ago
  • 1.0.11                                ...           5 years ago
  • 1.0.10                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (8)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE