代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<link rel="stylesheet" href="../index.css" />
<style>
html, body {
height: 100%;
margin: 0;
background: none;
}
#components-breadcrumb-demo-router iframe {
height: 180px;
}
.demo-nav {
height: 30px;
line-height: 30px;
margin-bottom: 15px;
background: #f8f8f8;
}
.demo-nav a {
line-height: 30px;
padding: 0 10px;
}
.app-list {
margin-top: 15px;
}
</style>
</head>
<body>
<div id="components-breadcrumb-demo-router" class="code-box-demo"></div>
<script>
function require(module) {
if (module === 'react-router') {
return window.ReactRouter;
}
return window.parent[module];
}
var mountNode = document.getElementById('components-breadcrumb-demo-router');
</script>
<script src="https://unpkg.com/react/dist/react.js"></script>
<script src="https://unpkg.com/react-dom/dist/react-dom.js"></script>
<script src="https://unpkg.com/react-router/umd/ReactRouter.js"></script>
<script>
'use strict';
var _reactRouter = require('react-router');
var _antd = require('antd');
var Apps = function Apps() {
return React.createElement(
'ul',
{ className: 'app-list' },
React.createElement(
'li',
null,
React.createElement(
_reactRouter.Link,
{ to: '/apps/1' },
'Application1'
),
':',
React.createElement(
_reactRouter.Link,
{ to: '/apps/1/detail' },
'Detail'
)
),
React.createElement(
'li',
null,
React.createElement(
_reactRouter.Link,
{ to: '/apps/2' },
'Application2'
),
':',
React.createElement(
_reactRouter.Link,
{ to: '/apps/2/detail' },
'Detail'
)
)
);
};
var Home = function Home(props) {
return React.createElement(
'div',
null,
React.createElement(
'div',
{ className: 'demo-nav' },
React.createElement(
_reactRouter.Link,
{ to: '/' },
'Home'
),
React.createElement(
_reactRouter.Link,
{ to: '/apps' },
'Application List'
)
),
props.children || 'Home',
React.createElement(
'div',
{
style: {
marginBottom: 15,
marginTop: 15,
paddingBottom: 15,
borderBottom: '1px dashed #ccc'
}
},
'Click the navigation above to switch:'
),
React.createElement(_antd.Breadcrumb, props)
);
};
ReactDOM.render(React.createElement(
_reactRouter.Router,
{ history: _reactRouter.hashHistory },
React.createElement(
_reactRouter.Route,
{ name: 'home', breadcrumbName: 'Home', path: '/', component: Home },
React.createElement(
_reactRouter.Route,
{ name: 'apps', breadcrumbName: 'Application List', path: 'apps', component: Apps },
React.createElement(
_reactRouter.Route,
{ name: 'app', breadcrumbName: 'Application:id', path: ':id' },
React.createElement(_reactRouter.Route, { name: 'detail', breadcrumbName: 'Detail', path: 'detail' })
)
)
)
), mountNode);
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。