mirror of
https://github.com/zuiidea/antd-admin.git
synced 2024-04-21 12:32:14 +00:00
ant-demo
ant-demo
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
*.iml
|
||||
.idea/
|
||||
.ipr
|
||||
.iws
|
||||
*~
|
||||
~*
|
||||
*.diff
|
||||
*.patch
|
||||
*.bak
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.project
|
||||
.*proj
|
||||
.svn/
|
||||
*.swp
|
||||
*.swo
|
||||
*.pyc
|
||||
*.pyo
|
||||
node_modules
|
||||
dist
|
||||
@@ -0,0 +1,25 @@
|
||||
# antd-demo
|
||||
|
||||
## Environment
|
||||
|
||||
```
|
||||
node >= 4
|
||||
```
|
||||
|
||||
## Code Style
|
||||
|
||||
https://github.com/airbnb/javascript
|
||||
|
||||
## Develop
|
||||
|
||||
```
|
||||
npm run dev
|
||||
```
|
||||
|
||||
访问 http://127.0.0.1:8989
|
||||
|
||||
## Build
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" type="text/css" href="./index.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>
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "antd-demo",
|
||||
"version": "1.0.0",
|
||||
"entry": {
|
||||
"index": "./src/entry/index.jsx"
|
||||
},
|
||||
"dependencies": {
|
||||
"antd": "0.11.x",
|
||||
"atool-build": "0.4.x",
|
||||
"babel-plugin-antd": "^0.1.2",
|
||||
"es3ify-loader": "^0.1.0",
|
||||
"react": "~0.14.3",
|
||||
"react-dom": "~0.14.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dora": "0.2.x",
|
||||
"dora-plugin-atool-build": "0.4.x",
|
||||
"dora-plugin-hmr": "0.3.x",
|
||||
"dora-plugin-proxy": "0.5.x",
|
||||
"eslint": "~1.10.3",
|
||||
"eslint-config-airbnb": "~2.1.0",
|
||||
"eslint-plugin-react": "~3.11.3",
|
||||
"pre-commit": "1.x"
|
||||
},
|
||||
"pre-commit": [
|
||||
"lint"
|
||||
],
|
||||
"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}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import 'antd/lib/index.css';
|
||||
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import { DatePicker, message } from 'antd';
|
||||
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
date: ''
|
||||
};
|
||||
},
|
||||
handleChange(value) {
|
||||
message.info('您选择的日期是: ' + value.toString());
|
||||
this.setState({
|
||||
date: value
|
||||
});
|
||||
},
|
||||
render() {
|
||||
return <div style={{width: 400, margin: '100px auto'}}>
|
||||
<DatePicker onChange={this.handleChange} />
|
||||
<div style={{marginTop: 20}}>当前日期:{this.state.date.toString()}</div>
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,6 @@
|
||||
import '../common/lib';
|
||||
import App from '../component/App';
|
||||
import ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('react-content'));
|
||||
@@ -0,0 +1,17 @@
|
||||
module.exports = function(webpackConfig) {
|
||||
webpackConfig.module.loaders.forEach(function(loader) {
|
||||
if (loader.loader === 'babel') {
|
||||
// https://github.com/ant-design/babel-plugin-antd
|
||||
loader.query.plugins.push('antd');
|
||||
}
|
||||
return loader;
|
||||
});
|
||||
|
||||
// Fix ie8 compatibility
|
||||
webpackConfig.module.loaders.unshift({
|
||||
test: /\.jsx?$/,
|
||||
loader: 'es3ify',
|
||||
});
|
||||
|
||||
return webpackConfig;
|
||||
};
|
||||
Reference in New Issue
Block a user