@fejs/route-utils
## Usage
Last updated 5 months ago by ineo6 .
MIT · Original npm · Tarball · package.json
$ cnpm install @fejs/route-utils 
SYNC missed versions from official npm registry.

@fejs/route-utils

Usage

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

## yarn
yarn add @fejs/route-utils

API

import {
  transformRoute,
  getMatchMenu,
  getMatchMenu,
} from ' @fejs/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 '@fejs/route-utils';

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

LICENSE

MIT

Current Tags

  • 1.0.1                                ...           latest (5 months ago)

1 Versions

  • 1.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |