admin-demo

This commit is contained in:
zuiidea
2016-01-27 16:56:51 +08:00
parent c42024fbed
commit 9838869517
10 changed files with 119 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="../common.css"/>
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
</head>
<body>
<div id="react-content">
</div>
</body>
<script src="../common.js"></script>
<script src="../index.js"></script>
</html>
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="../common.css"/>
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
</head>
<body>
<div id="react-content">
</div>
</body>
<script src="../common.js"></script>
<script src="../dist/admin/user.js"></script>
</html>
+5 -2
View File
@@ -3,13 +3,16 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="./index.css"/>
<link rel="stylesheet" type="text/css" href="./common.css"/>
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
</head>
<body>
<div id="react-content"></div>
<div id="react-content">
</div>
</body>
<script src="./common.js"></script>
<script src="./index.js"></script>
+10 -2
View File
@@ -2,8 +2,15 @@
"name": "antd-demo",
"version": "1.0.0",
"entry": {
"index": "./src/entry/index.jsx"
"index": "./src/entry/index.jsx",
"admin/index": ["./src/entry/admin/index.jsx"],
"admin/user": ["./src/entry/admin/user.jsx"]
},
"output": {
"path": "dist",
"filename": "index_bundle.js"
},
"plugins": "[new HtmlWebpackPlugin()]",
"dependencies": {
"antd": "0.11.x",
"atool-build": "0.4.x",
@@ -20,6 +27,7 @@
"eslint": "~1.10.3",
"eslint-config-airbnb": "~2.1.0",
"eslint-plugin-react": "~3.11.3",
"html-webpack-plugin": "^2.7.2",
"pre-commit": "1.x"
},
"pre-commit": [
@@ -28,6 +36,6 @@
"scripts": {
"dev": "dora -p 8001 --plugins atool-build,proxy,hmr",
"lint": "eslint --ext .js,.jsx src",
"build": "atool-build -o ./dist/${npm_package_family}/${npm_package_name/{npm_package_version}"
"build": "atool-build -o ./dist"
}
}
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="../dist/common.css"/>
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
</head>
<body>
<div id="react-content">
</div>
</body>
<script src="../dist/common.js"></script>
<script src="../dist/admin/index.js"></script>
</html>
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="../dist/common.css"/>
<!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
</head>
<body>
<div id="react-content">
</div>
</body>
<script src="../dist/common.js"></script>
<script src="../dist/admin/user.js"></script>
</html>
+2 -2
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { DatePicker, message } from 'antd';
import { DatePicker , message , Button , Menu, Dropdown, Icon } from 'antd';
const App = React.createClass({
getInitialState() {
@@ -21,4 +21,4 @@ const App = React.createClass({
}
});
export default App;
export default App;
+12
View File
@@ -0,0 +1,12 @@
import '../../common/lib';
import { Button ,Switch ,Icon} from 'antd';
import ReactDOM from 'react-dom';
import React from 'react';
function onChange(checked){
console.log('switch to ' + checked);
}
ReactDOM.render(<div><Button type="ghost">后台首页</Button>
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
<Switch defaultChecked={false} onChange={onChange} /></div>, document.getElementById('react-content'));
+12
View File
@@ -0,0 +1,12 @@
import '../../common/lib';
import { Button ,Switch ,Icon} from 'antd';
import ReactDOM from 'react-dom';
import React from 'react';
function onChange(checked){
console.log('switch to ' + checked);
}
ReactDOM.render(<div><Button type="ghost">用户</Button>
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
<Switch defaultChecked={false} onChange={onChange} /></div>, document.getElementById('react-content'));
+6
View File
@@ -1,4 +1,10 @@
// require('./admin/index.html');
module.exports = function(webpackConfig) {
webpackConfig.module.loaders.push({
test: /\.html$/,
loader: 'file?name=[name].[ext]'
});
webpackConfig.module.loaders.forEach(function(loader) {
if (loader.loader === 'babel') {
// https://github.com/ant-design/babel-plugin-antd