From 581040fc5d1e22315c7993ce42beba264a9f7347 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 6 Apr 2017 14:10:01 +0800 Subject: [PATCH] fix: Breadcrumb should work with react-router@4 --- components/breadcrumb/demo/router-4.md | 75 +++++++++++++++++++++++++ components/breadcrumb/demo/router.md | 5 +- components/breadcrumb/demo/separator.md | 2 +- package.json | 2 +- 4 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 components/breadcrumb/demo/router-4.md diff --git a/components/breadcrumb/demo/router-4.md b/components/breadcrumb/demo/router-4.md new file mode 100644 index 0000000000..3fee5f61e6 --- /dev/null +++ b/components/breadcrumb/demo/router-4.md @@ -0,0 +1,75 @@ +--- +order: 3 +iframe: 200 +reactRouter: react-router-dom +title: + zh-CN: 路由 + en-US: React Router Integration +--- + +## zh-CN + +和 `react-router@4` 进行结合使用。 + +## en-US + +Used together with `react-router@4`. + +````jsx +import { HashRouter as Router, Route, Link } from 'react-router-dom'; +import { Breadcrumb, Alert } from 'antd'; + +const Apps = () => ( + +); + +const Home = ({ routes, params, children }) => ( +
+
+ Home + Application List +
+ {children || 'Home Page'} + + +
+); + +ReactDOM.render( + + + + + + + + + +, mountNode); +```` + +````css +.demo { + margin: 16px; +} +.demo-nav { + height: 30px; + line-height: 30px; + margin-bottom: 16px; + background: #f8f8f8; +} +.demo-nav a { + line-height: 30px; + padding: 0 8px; +} +.app-list { + margin-top: 16px; +} +```` diff --git a/components/breadcrumb/demo/router.md b/components/breadcrumb/demo/router.md index 4628ca21e0..e0f7529856 100644 --- a/components/breadcrumb/demo/router.md +++ b/components/breadcrumb/demo/router.md @@ -1,6 +1,7 @@ --- order: 2 iframe: 200 +reactRouter: react-router title: zh-CN: 路由 en-US: React Router Integration @@ -8,11 +9,11 @@ title: ## zh-CN -和 `react-router@2+` 进行结合使用。 +和 `react-router@2` `react-router@3` 进行结合使用。 ## en-US -Used together with `react-router@2+`. +Used together with `react-router@2` `react-router@3`. ````jsx import { Router, Route, Link, hashHistory } from 'react-router'; diff --git a/components/breadcrumb/demo/separator.md b/components/breadcrumb/demo/separator.md index 79b39ae20b..a02836b116 100644 --- a/components/breadcrumb/demo/separator.md +++ b/components/breadcrumb/demo/separator.md @@ -1,5 +1,5 @@ --- -order: 3 +order: 4 title: zh-CN: 分隔符 en-US: Configuring the Separator diff --git a/package.json b/package.json index 3c53140ac2..3500ac2f04 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "babel-preset-stage-0": "^6.16.0", "bezier-easing": "^2.0.3", "bisheng": "^0.23.0", - "bisheng-plugin-antd": "^0.13.2", + "bisheng-plugin-antd": "^0.15.0", "bisheng-plugin-description": "^0.1.1", "bisheng-plugin-react": "^0.5.0", "bisheng-plugin-toc": "^0.4.0",