mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-25 01:40:20 +00:00
main layout
This commit is contained in:
+10
-6
@@ -1,15 +1,19 @@
|
||||
import React from 'react'
|
||||
import { Router, Route } from 'dva/router'
|
||||
import Index from './routes/index'
|
||||
import { Router, Route , IndexRedirect , hashHistory} from 'dva/router'
|
||||
import App from './components/layout/main'
|
||||
import NotFound from './routes/NotFound'
|
||||
import Dashboard from './routes/dashboard'
|
||||
import Users from './routes/users'
|
||||
|
||||
export default function ({ history }) {
|
||||
return (
|
||||
<Router history={history}>
|
||||
<Route path="/" component={Index} />
|
||||
<Route path="/users" component={Users} />
|
||||
<Route path="*" component={NotFound} />
|
||||
<Router history={ history }>
|
||||
<Route path="/" component={ App } >
|
||||
<IndexRedirect to="/dashboard" />
|
||||
<Route path="dashboard" component={Dashboard}/>
|
||||
<Route path="/users" component={ Users } />
|
||||
<Route path="*" component={ NotFound } />
|
||||
</Route>
|
||||
</Router>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -86,13 +86,11 @@ function Users({ location, dispatch, users }) {
|
||||
<UserModal {...userModalProps} />
|
||||
|
||||
return (
|
||||
<Main location={location}>
|
||||
<div className={styles.normal}>
|
||||
<UserSearch {...userSearchProps} />
|
||||
<UserList {...userListProps} />
|
||||
<UserModalGen />
|
||||
</div>
|
||||
</Main>
|
||||
<div className={styles.normal}>
|
||||
<UserSearch {...userSearchProps} />
|
||||
<UserList {...userListProps} />
|
||||
<UserModalGen />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React from 'react'
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Link } from 'dva/router'
|
||||
import styles from './Index.less'
|
||||
import Main from '../components/layout/main'
|
||||
import styles from './app.less'
|
||||
|
||||
function HomePage() {
|
||||
function Dashboard() {
|
||||
return (
|
||||
<div className={styles.normal}>
|
||||
<h1>Hello Antd.</h1>
|
||||
@@ -14,7 +15,8 @@ function HomePage() {
|
||||
)
|
||||
}
|
||||
|
||||
HomePage.propTypes = {
|
||||
Dashboard.propTypes = {
|
||||
location: PropTypes.object,
|
||||
}
|
||||
|
||||
export default HomePage
|
||||
export default Dashboard
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
.normal {
|
||||
margin: 100px;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 20px;
|
||||
}
|
||||
Reference in New Issue
Block a user