-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
122 changed files
with
8,077 additions
and
2,107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,61 @@ | ||
# react手脚架 | ||
|
||
> 相关技术栈 | ||
- react | ||
- redux | ||
- stylus | ||
- eslint | ||
|
||
## 目录结构 | ||
|
||
/ 根目录 | ||
|__ build webpack配置 | ||
|__ config 环境配置 | ||
|__ dist 生成结果 | ||
|__ src 源文件 | ||
| |__ assets 静态目录 | ||
| |__ components 公用组件 | ||
| |__ redux redux状态管理 | ||
| |__ routers 路由管理 | ||
| |__ services 接口管理 | ||
| |__ utils 工具类 | ||
| |__ views 页面路径 | ||
| |__ app.jsx jsx入口 | ||
| |__ main.js 主文文件 | ||
|__ index.html 应用入口文件 | ||
|__ package.json npm依赖管理 | ||
|
||
## 使用 | ||
|
||
```bash | ||
# 依赖安装 | ||
npm install | ||
|
||
# 开发模式,默认端口:8080 | ||
npm run dev | ||
|
||
# 打包 | ||
npm run build | ||
|
||
# eslint检测 | ||
npm run lint | ||
``` | ||
# react手脚架 | ||
|
||
## 相关技术栈 | ||
|
||
- react | ||
- redux | ||
- stylus | ||
- eslint | ||
- webpack2 | ||
- antd | ||
|
||
## 目录结构 | ||
|
||
/ 根目录 | ||
|__ build # webpack配置 | ||
|__ config # 环境配置 | ||
|__ dist # 生成结果 | ||
├── src # 程序源文件 | ||
│ ├── main.js # 程序启动和渲染 | ||
│ ├── components # 全局可复用的表现组件(Presentational Components) | ||
│ ├── containers # 全局可复用的容器组件 | ||
│ ├── layouts # 主页结构 | ||
│ ├── static # 静态文件(不要到处imported源文件) | ||
│ ├── styles # 程序样式 | ||
│ ├── store # Redux指定块 | ||
│ │ ├── createStore.js # 创建和使用redux store | ||
│ │ └── reducers.js # Reducer注册和注入 | ||
│ └── routes # 主路由和异步分割点 | ||
│ ├── index.js # 用store启动主程序路由 | ||
│ └── Home # 不规则路由 | ||
│ ├── index.js # 路由定义和代码异步分割 | ||
│ ├── assets # 组件引入的静态资源 | ||
│ ├── components # 直观React组件 | ||
│ ├── container # 连接actions和store | ||
│ └── modules # reducers/constants/actions的集合 | ||
├── index.html # 应用入口文件 | ||
└──package.json # npm依赖管理 | ||
|
||
## 使用 | ||
|
||
```bash | ||
# 依赖安装 | ||
npm install | ||
|
||
# 开发模式,默认端口:8080 | ||
npm run dev | ||
|
||
# 打包 | ||
npm run build | ||
|
||
# eslint检测 | ||
npm run lint | ||
``` | ||
|
||
## 代码处理流程 | ||
|
||
main.js => router => views => redux | ||
|
||
action => types => reducers => store => connect => views | ||
|
||
组件 -->action--> thunk中间件-->ajax请求-->reducer-->store->组件 |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const merge = require('webpack-merge'); | ||
const prodEnv = require('./prod.env'); | ||
|
||
module.exports = merge(prodEnv, { | ||
NODE_ENV: '"development"' | ||
}); | ||
const merge = require('webpack-merge'); | ||
const prodEnv = require('./prod.env'); | ||
|
||
module.exports = merge(prodEnv, { | ||
NODE_ENV: '"development"' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
// see http://vuejs-templates.github.io/webpack for documentation. | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
build: { | ||
env: require('./prod.env'), | ||
index: path.resolve(__dirname, '../dist/index.html'), | ||
assetsRoot: path.resolve(__dirname, '../dist'), | ||
assetsSubDirectory: 'static', | ||
assetsPublicPath: '/', | ||
productionSourceMap: true, | ||
// Gzip off by default as many popular static hosts such as | ||
// Surge or Netlify already gzip all static assets for you. | ||
// Before setting to `true`, make sure to: | ||
// npm install --save-dev compression-webpack-plugin | ||
productionGzip: false, | ||
productionGzipExtensions: ['js', 'css'], | ||
// Run the build command with an extra argument to | ||
// View the bundle analyzer report after build finishes: | ||
// `npm run build --report` | ||
// Set to `true` or `false` to always turn it on or off | ||
bundleAnalyzerReport: process.env.npm_config_report | ||
}, | ||
dev: { | ||
env: require('./dev.env'), | ||
port: 8090, | ||
autoOpenBrowser: true, | ||
assetsSubDirectory: 'static', | ||
assetsPublicPath: '/', | ||
proxyTable: {}, | ||
// CSS Sourcemaps off by default because relative paths are "buggy" | ||
// with this option, according to the CSS-Loader README | ||
// (https://github.com/webpack/css-loader#sourcemaps) | ||
// In our experience, they generally work as expected, | ||
// just be aware of this issue when enabling this option. | ||
cssSourceMap: false | ||
} | ||
}; | ||
// see http://vuejs-templates.github.io/webpack for documentation. | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
build: { | ||
env: require('./prod.env'), | ||
index: path.resolve(__dirname, '../dist/index.html'), | ||
assetsRoot: path.resolve(__dirname, '../dist'), | ||
assetsSubDirectory: 'static', | ||
assetsPublicPath: '/', | ||
productionSourceMap: true, | ||
// Gzip off by default as many popular static hosts such as | ||
// Surge or Netlify already gzip all static assets for you. | ||
// Before setting to `true`, make sure to: | ||
// npm install --save-dev compression-webpack-plugin | ||
productionGzip: false, | ||
productionGzipExtensions: ['js', 'css'], | ||
// Run the build command with an extra argument to | ||
// View the bundle analyzer report after build finishes: | ||
// `npm run build --report` | ||
// Set to `true` or `false` to always turn it on or off | ||
bundleAnalyzerReport: process.env.npm_config_report | ||
}, | ||
dev: { | ||
env: require('./dev.env'), | ||
port: 8091, | ||
autoOpenBrowser: true, | ||
assetsSubDirectory: 'static', | ||
assetsPublicPath: '/', | ||
proxyTable: { | ||
// '/api': { | ||
// target: 'http://192.168.220.70:8080/api/', | ||
// changeOrigin: true, | ||
// pathRewrite: { | ||
// '^/api': '' | ||
// } | ||
// } | ||
}, | ||
// CSS Sourcemaps off by default because relative paths are "buggy" | ||
// with this option, according to the CSS-Loader README | ||
// (https://github.com/webpack/css-loader#sourcemaps) | ||
// In our experience, they generally work as expected, | ||
// just be aware of this issue when enabling this option. | ||
cssSourceMap: false | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
NODE_ENV: '"production"' | ||
}; | ||
module.exports = { | ||
NODE_ENV: '"production"' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>xx</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>账户平台</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures. | ||
|
||
To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts | ||
|
||
You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects. | ||
|
||
You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection. |
Oops, something went wrong.