Skip to content

Commit 0eec34b

Browse files
author
xiongyj
committed
第二次初始化
1 parent 4287975 commit 0eec34b

17 files changed

+227
-355
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/echarts/*i*

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ module.exports = function (grunt) {
107107
});
108108

109109
grunt.registerTask('serve', function (target) {
110+
console.log(target);
110111
if (target === 'dist') {
111112
return grunt.task.run(['build', 'open:dist', 'connect:dist']);
112113
}

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# 创宇盾星图
2-
* 前端架构 reactjs + reflux + webpack + 百度echarts + grunt + less, 采用ES6语法+ babel解析器
2+
* 前端架构 reactjs + reflux模型 + webpack + 百度echarts + grunt + less, 采用ES6语法+ babel解析器
3+
## getting start
4+
5+
### 本地开发
6+
* `npm install`
7+
* `grunt serve`
8+
+ grunt serve会启动本地开发服务器 webpack-dev-server
9+
+ webpack-dev-server方便使用热替换,程序一修改,界面马上改变
10+
+ 所以本地开发路径为:[http://localhost:8000/webpack-dev-server/](http://localhost:8000/webpack-dev-server/) 不要奇怪
11+
12+
### 线上模式
13+
* `npm install`
14+
* `grunt build`
15+
+ 在dist 目录生产静态的文件,挂载到nignix 就行了
16+
17+
### 参考资料
18+
* reactjs
19+
+ [reactjs](http://facebook.github.io/react/)是以组件为基础,基于虚拟DOM和单向数据流的前端javascript库
20+
+ [reactjs 中文网](http://reactjs.cn/)
21+
22+
* flux结构
23+
+ [flux](https://github.com/facebook/flux)是一种前端架构,区别于传统前端MVC
24+
+ [reflux](https://github.com/reflux/refluxjs)是flux结构的一种具体实现
25+
26+
* webpack
27+
+ [webpack](https://webpack.github.io/)是模块加载器,其允许把npm包,图片和css整体打包到前端
28+
29+
* 百度echarts
30+
+ [echarts](http://echarts.baidu.com/) 是百度开发的基于zRender库的开源图表库

npm-debug.log

Lines changed: 0 additions & 228 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
"mainInput": "main",
1111
"mainOutput": "main",
1212
"dependencies": {
13-
"react-router": "0.13.x",
14-
"reflux": "^0.2.7",
13+
"echarts": "^2.2.7-webpack",
14+
"normalize.css": "~3.0.3",
1515
"react": "0.13.x",
16-
"normalize.css": "~3.0.3"
16+
"react-router": "0.13.x",
17+
"reflux": "^0.2.7"
1718
},
1819
"devDependencies": {
1920
"babel": "^5.0.0",

src/actions/ActionActionCreators.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/actions/Actions.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
import Reflux from 'reflux';
4+
5+
let ImageActions = Reflux.createActions({
6+
'fetchList': {},
7+
'login': {children: ['success', 'failed']}
8+
});
9+
export default ImageActions;
10+
11+
12+

src/app.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
import React from 'react';
3+
import Router from 'react-router';
4+
import form from './components/form';
5+
import hacked from './components/hacked';
6+
7+
let Route = Router.Route;
8+
let RouteHandler = Router.RouteHandler;
9+
let DefaultRoute = Router.DefaultRoute;
10+
11+
let content = document.getElementById('content');
12+
13+
let App = React.createClass({
14+
render() {
15+
return <RouteHandler />;
16+
}
17+
});
18+
19+
let Routes = (
20+
<Route path="/" handler={App}>
21+
<DefaultRoute handler={hacked}/>
22+
<Route path="form" handler={form} />
23+
<Route path="hacked" handler={hacked} />
24+
</Route>
25+
);
26+
27+
Router.run(Routes, function (Handler) {
28+
React.render(<Handler/>, content);
29+
});

src/components/Component.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/components/GalaxyApp.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)