From cf397a27f06e1044a7e0e45e5ac92f6e123c94e0 Mon Sep 17 00:00:00 2001 From: memoryza Date: Thu, 19 Oct 2017 09:36:49 -0500 Subject: [PATCH] update Breadcrumb readme (#7947) * update Breadcrumb readme * update english --- components/breadcrumb/index.en-US.md | 12 +++++++++++- components/breadcrumb/index.zh-CN.md | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/components/breadcrumb/index.en-US.md b/components/breadcrumb/index.en-US.md index 706816c107..db86d5432a 100644 --- a/components/breadcrumb/index.en-US.md +++ b/components/breadcrumb/index.en-US.md @@ -31,10 +31,20 @@ The link of Breadcrumb item targets `#` by default, you can use `itemRender` to ```jsx 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 ? {route.breadcrumbName} : {route.breadcrumbName}; } -return ; +return ; ``` diff --git a/components/breadcrumb/index.zh-CN.md b/components/breadcrumb/index.zh-CN.md index 28e7bafecf..7ff46a4a09 100644 --- a/components/breadcrumb/index.zh-CN.md +++ b/components/breadcrumb/index.zh-CN.md @@ -31,10 +31,20 @@ title: Breadcrumb ```jsx import { Link } from 'react-router'; +const routes = [{ + path: 'index', + breadcrumbName: '首页' +}, { + path: 'first', + breadcrumbName: '一级面包屑' +}, { + path: 'second', + breadcrumbName: '当前页面' +}]; function itemRender(route, params, routes, paths) { const last = routes.indexOf(route) === routes.length - 1; return last ? {route.breadcrumbName} : {route.breadcrumbName}; } -return ; +return ; ```