mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-29 12:37:20 +00:00
ico
This commit is contained in:
@@ -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} />
|
||||
: ''}
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
.ico {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
|
||||
const IcoPage = () => <div>666</div>
|
||||
|
||||
|
||||
export default IcoPage
|
||||
@@ -0,0 +1,7 @@
|
||||
.ico {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -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
@@ -10,9 +10,10 @@ module.exports = [
|
||||
icon: 'user',
|
||||
},
|
||||
{
|
||||
key: 'components',
|
||||
key: 'ui',
|
||||
name: 'UI组件',
|
||||
icon: 'laptop',
|
||||
clickable:false,
|
||||
child:[
|
||||
{
|
||||
key: 'ico',
|
||||
|
||||
Reference in New Issue
Block a user