From 1a3ea0f24461c4cd1cc400b147da9e2786fc0756 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Fri, 14 Oct 2016 00:26:36 +0800 Subject: [PATCH] main layout --- src/router.js | 16 ++++++++++------ src/routes/Users.jsx | 12 +++++------- src/routes/{index.jsx => dashboard.jsx} | 12 +++++++----- src/routes/index.less | 8 -------- 4 files changed, 22 insertions(+), 26 deletions(-) rename src/routes/{index.jsx => dashboard.jsx} (53%) delete mode 100644 src/routes/index.less diff --git a/src/router.js b/src/router.js index 8679040..2c9e393 100644 --- a/src/router.js +++ b/src/router.js @@ -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 ( - - - - + + + + + + + ) } diff --git a/src/routes/Users.jsx b/src/routes/Users.jsx index 0cc7124..d04bdee 100644 --- a/src/routes/Users.jsx +++ b/src/routes/Users.jsx @@ -86,13 +86,11 @@ function Users({ location, dispatch, users }) { return ( -
-
- - - -
-
+
+ + + +
) } diff --git a/src/routes/index.jsx b/src/routes/dashboard.jsx similarity index 53% rename from src/routes/index.jsx rename to src/routes/dashboard.jsx index 9b34713..c1e4984 100644 --- a/src/routes/index.jsx +++ b/src/routes/dashboard.jsx @@ -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 (

Hello Antd.

@@ -14,7 +15,8 @@ function HomePage() { ) } -HomePage.propTypes = { +Dashboard.propTypes = { + location: PropTypes.object, } -export default HomePage +export default Dashboard diff --git a/src/routes/index.less b/src/routes/index.less deleted file mode 100644 index cc48bd6..0000000 --- a/src/routes/index.less +++ /dev/null @@ -1,8 +0,0 @@ - -.normal { - margin: 100px; -} - -.list { - margin-top: 20px; -}