From 921d3bce463d4421aabd4b06c7676c8505465c7c Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 30 Mar 2016 19:30:16 +0800 Subject: [PATCH] hidden breadcrumb href in Doc --- components/breadcrumb/demo/basic.md | 6 +++--- components/breadcrumb/index.jsx | 10 ++++++---- components/breadcrumb/index.md | 12 ++---------- style/components/breadcrumb.less | 6 +++--- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/components/breadcrumb/demo/basic.md b/components/breadcrumb/demo/basic.md index 929a62de21..0f19b381e9 100644 --- a/components/breadcrumb/demo/basic.md +++ b/components/breadcrumb/demo/basic.md @@ -2,7 +2,7 @@ - order: 0 -最简单的用法,存在 `href` 表示可点。 +最简单的用法。 --- @@ -12,8 +12,8 @@ import { Breadcrumb } from 'antd'; ReactDOM.render( 首页 - 应用中心 - 应用列表 + 应用中心 + 应用列表 某应用 , mountNode); diff --git a/components/breadcrumb/index.jsx b/components/breadcrumb/index.jsx index 7836190b68..8b560bddcb 100644 --- a/components/breadcrumb/index.jsx +++ b/components/breadcrumb/index.jsx @@ -17,10 +17,12 @@ class BreadcrumbItem extends React.Component { } render() { - const { prefixCls, separator, children } = this.props; - let link = {children}; - if (typeof this.props.href === 'undefined') { - link = {children}; + const { prefixCls, separator, children, ...restProps } = this.props; + let link; + if ('href' in this.props) { + link = {children}; + } else { + link = {children}; } return ( diff --git a/components/breadcrumb/index.md b/components/breadcrumb/index.md index 116cc4351b..cb9b8c1e4d 100644 --- a/components/breadcrumb/index.md +++ b/components/breadcrumb/index.md @@ -19,23 +19,15 @@ ```html 首页 - 应用中心 - 应用列表 + 应用中心 + 应用列表 某应用 ``` -### Breadcrumb - | 参数 | 说明 | 类型 | 可选值 | 默认值 | |-----------|-----------------------------------|-------------------|---------|--------| | routes | router 的路由栈信息 | Array | | - | | params | 路由的参数 | Object | | - | | separator | 分隔符自定义 | String or Element | | '/' | | linkRender | 自定义链接函数,和 react-router 配置使用 | Function(href, name) | | - | - -### Breadcrumb.Item - -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|-----------|------------------------------------------|------------|---------|--------| -| href | 链接,如不传则不可点击 | string | | - | diff --git a/style/components/breadcrumb.less b/style/components/breadcrumb.less index fcf2c73065..317781d14f 100644 --- a/style/components/breadcrumb.less +++ b/style/components/breadcrumb.less @@ -2,15 +2,15 @@ .@{breadcrumb-prefix-cls} { color: #999; - font-size: 12px; + font-size: @font-size-base; a { - color: #666; + color: @text-color; } & > span:last-child { font-weight: bold; - color: #666; + color: @text-color; } & > span:last-child &-separator {