1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/open-hand-choerodon-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
index.en-US.md 2.5 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
sundar gao Отправлено 5 лет назад f7c51f8
category type title
Components
Navigation
Breadcrumb

A breadcrumb displays the current location within a hierarchy. It allows going back to states higher up in the hierarchy.

When To Use

  • When the system has more than two layers in a hierarchy.
  • When you need to inform the user of where they are.
  • When the user may need to navigate back to a higher level.
  • When the application has multi-layer architecture.

API

Property Description Type Optional Default
itemRender Custom item renderer (route, params, routes, paths) => ReactNode -
params Routing parameters object -
routes The routing stack information of router object[] -
separator Custom separator string|ReactNode /

BreadcrumbItem API

Property Description Type Optional Default
separator Separator customization ReactNode -
href link address string -
overlay Rendering in the drop-down box object[] -
dropdownProps For details on the property configuration of the drop-down box, please see the dropdown of the basic component DropDownProps -
menuList Configure the display of horizontal drop-down lists object[] -
ListProps When using menulist rendering object[] -
onClick Click to trigger the callback function (e) => {} -

menuList API

Property Description Type Optional Default
listItemName List display text string -
href link address string -
listChildren You can get the display text and render the desired display ({ listItemName, href }: { listItemName: string, href: string }) => React.ReactNode -
onClick Click to trigger the callback function (e) => {} -

Use with browserHistory

The link of Breadcrumb item targets # by default, you can use itemRender to make a browserHistory Link.

import { Link } from 'react-router';

const routes = [{
  path: 'index',
  breadcrumbName: 'home'
}, {
  path: 'first',
  breadcrumbName: 'first'
}, {
  path: 'second',
  breadcrumbName: 'second'
}];
function itemRender(route, params, routes, paths) {
  const last = routes.indexOf(route) === routes.length - 1;
  return last ? <span>{route.breadcrumbName}</span> : <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
}

return <Breadcrumb itemRender={itemRender} routes={routes} />;

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/open-hand-choerodon-ui.git
git@gitlife.ru:oschina-mirror/open-hand-choerodon-ui.git
oschina-mirror
open-hand-choerodon-ui
open-hand-choerodon-ui
master