This commit is contained in:
zuiidea
2016-12-25 18:15:07 +08:00
parent 7e521d5f05
commit a79139fbc9
10 changed files with 34 additions and 3 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ const getPathSet = function (menuArray, parentPath) {
path: parentPath + item.key,
name: item.name,
icon: item.icon || '',
clickable:item.clickable==undefined?true:false
}
if (!!item.child) {
getPathSet(item.child, parentPath + item.key + '/')
@@ -30,7 +31,7 @@ function Bread({ location }) {
})
const breads = pathNames.map((item, key) => {
return (
<Breadcrumb.Item key={key} {...pathNames.length - 1 == key ? '' : { href: '#' + pathSet[item].path }}>
<Breadcrumb.Item key={key} {...((pathNames.length - 1 == key)||!pathSet[item].clickable)? '' : { href: '#' + pathSet[item].path }}>
{pathSet[item].icon
? <Icon type={pathSet[item].icon} />
: ''}
+8
View File
@@ -0,0 +1,8 @@
import React, { PropTypes } from 'react'
import styles form './ico.less'
const Ico = (type) => <svg className={styles.ico} aria-hidden="true">
<use xlink:href={`#icon-${type}`}></use>
</svg>
export default Ico
+7
View File
@@ -0,0 +1,7 @@
.ico {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
+2
View File
@@ -4,6 +4,7 @@ import App from './routes/app'
import Error from './routes/error'
import Dashboard from './routes/dashboard'
import Users from './routes/users'
import Ico from './routes/ui/ico'
export default function ({ history }) {
return (
@@ -12,6 +13,7 @@ export default function ({ history }) {
<IndexRedirect to="/dashboard" />
<Route path="dashboard" component={ Dashboard }/>
<Route path="/users" component={ Users } />
<Route path="/ui/ico" component={Ico}/>
<Route path="*" component={ Error } />
</Route>
</Router>
View File
View File
+6
View File
@@ -0,0 +1,6 @@
import React, { PropTypes } from 'react'
const IcoPage = () => <div>666</div>
export default IcoPage
+7
View File
@@ -0,0 +1,7 @@
.ico {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
-1
View File
@@ -1,7 +1,6 @@
import React, { PropTypes } from 'react'
import { routerRedux } from 'dva/router'
import { connect } from 'dva'
import styles from './users.less'
import UserList from '../components/users/list'
import UserSearch from '../components/users/search'
import UserModal from '../components/users/modal'
+2 -1
View File
@@ -10,9 +10,10 @@ module.exports = [
icon: 'user',
},
{
key: 'components',
key: 'ui',
name: 'UI组件',
icon: 'laptop',
clickable:false,
child:[
{
key: 'ico',