mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-28 20:03:57 +00:00
dy-router
This commit is contained in:
@@ -32,20 +32,17 @@ function Bread({ location }) {
|
||||
}
|
||||
})
|
||||
const breads = pathNames.map((item, key) => {
|
||||
if (item=='-'){
|
||||
return <Breadcrumb.Item key={key}>
|
||||
无
|
||||
</Breadcrumb.Item>
|
||||
}else {
|
||||
return (
|
||||
<Breadcrumb.Item key={key} {...((pathNames.length - 1 == key)||!pathSet[item].clickable)? '' : { href: '#' + pathSet[item].path }}>
|
||||
{pathSet[item].icon
|
||||
? <Icon type={pathSet[item].icon} />
|
||||
: ''}
|
||||
<span>{pathSet[item].name}</span>
|
||||
</Breadcrumb.Item>
|
||||
)
|
||||
if(item=='-'){
|
||||
item='Dashboard'
|
||||
}
|
||||
return (
|
||||
<Breadcrumb.Item key={key} {...((pathNames.length - 1 == key)||!pathSet[item].clickable)? '' : { href: '#' + pathSet[item].path }}>
|
||||
{pathSet[item].icon
|
||||
? <Icon type={pathSet[item].icon} />
|
||||
: ''}
|
||||
<span>{pathSet[item].name}</span>
|
||||
</Breadcrumb.Item>
|
||||
)
|
||||
})
|
||||
|
||||
return (
|
||||
|
||||
+6
-4
@@ -1,7 +1,6 @@
|
||||
import React from 'react'
|
||||
import {Router} from 'dva/router'
|
||||
import App from './routes/app'
|
||||
import Error from './routes/error'
|
||||
|
||||
export default function ({history, app}) {
|
||||
|
||||
@@ -9,9 +8,12 @@ export default function ({history, app}) {
|
||||
{
|
||||
path: '/',
|
||||
component: App,
|
||||
// IndexRoute:{
|
||||
// component: Error,
|
||||
// },
|
||||
getIndexRoute(nextState, cb) {
|
||||
require.ensure([], require => {
|
||||
app.model(require('./models/dashboard'))
|
||||
cb(null, {component: require('./routes/dashboard')})
|
||||
})
|
||||
},
|
||||
childRoutes: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
|
||||
Reference in New Issue
Block a user