From c42ca53d91b100d42a4e6abf5d0a3de5625131eb Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 2 Jul 2015 18:33:37 +0800 Subject: [PATCH] breadcrumb --- components/breadcrumb/index.jsx | 12 ++++++++---- style/components/breadcrumb.less | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/breadcrumb/index.jsx b/components/breadcrumb/index.jsx index df7b6a0c53..87fc06337c 100644 --- a/components/breadcrumb/index.jsx +++ b/components/breadcrumb/index.jsx @@ -27,13 +27,17 @@ let Breadcrumb = React.createClass({ if (this.context.router) { routes = this.context.router.getCurrentRoutes(); params = this.context.router.getCurrentParams(); - crumbs = routes.map(function(route) { + crumbs = routes.map(function(route, i) { var name = route.name.replace(/\:(.*)/g, function(replacement, key) { return params[key] || replacement; }); - return - {name} - ; + var link; + if (i === routes.length - 1) { + link = {name}; + } else { + link = {name}; + } + return {link}; }); } else { crumbs = this.props.children; diff --git a/style/components/breadcrumb.less b/style/components/breadcrumb.less index 6a557bf179..5715702c52 100644 --- a/style/components/breadcrumb.less +++ b/style/components/breadcrumb.less @@ -4,7 +4,7 @@ color: #999; font-size: 12px; - a&-link { + a { color: #666; }