Skip to content

Commit 464d536

Browse files
author
chenghao
committed
add react-admin cli useage
1 parent d34bee8 commit 464d536

1 file changed

Lines changed: 124 additions & 69 deletions

File tree

README.md

Lines changed: 124 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# react-admin([尝试一下](https://codesandbox.io/s/react-admin-u9kdb))
2+
23
react-admin system solution
34

45
<img src="https://raw.githubusercontent.com/yezihaohao/react-admin/master/screenshots/logo.png" alt="logo" width="150" height="53" />
@@ -12,100 +13,139 @@ react-admin system solution
1213

1314
### 更新日志迁移至[CHANGELOG.md](https://github.com/yezihaohao/react-admin/blob/master/CHANGELOG.md)😁(重要!对于了解项目部分功能和代码很有用!)
1415

16+
### cli 安装和使用 react-admin 🔥
17+
18+
使用 react-admin-creator 快速安装和下载 react-admin 模板来开发项目:
19+
20+
```js
21+
npm i -g react-admin-creator
22+
23+
react-admin-creator myapp
24+
```
25+
1526
### 前言
16-
> 网上react后台管理开源免费的完整版项目比较少,所以利用空余时间集成了一个版本出来,已放到GitHub
17-
启动和打包的时间都稍长,请耐心等待两分钟
1827

19-
- [GitHub地址](https://github.com/yezihaohao/react-admin)
20-
- [预览地址](https://admiring-dijkstra-34cb29.netlify.com)(已增加响应式,可手机预览😄)
28+
> 网上 react 后台管理开源免费的完整版项目比较少,所以利用空余时间集成了一个版本出来,已放到 GitHub
29+
> 启动和打包的时间都稍长,请耐心等待两分钟
30+
31+
- [GitHub 地址](https://github.com/yezihaohao/react-admin)
32+
- [预览地址](https://admiring-dijkstra-34cb29.netlify.com)(已增加响应式,可手机预览 😄)
2133

2234
### 依赖模块
23-
<span style="color: rgb(184,49,47);">项目是用create-react-app创建的,主要还是列出新加的功能依赖包</span>
24-
25-
<span style="color: rgb(184,49,47);">点击名称可跳转相关网站😄😄</span>
26-
27-
- [react](https://facebook.github.io/react/)
28-
- [react-router](https://react-guide.github.io/react-router-cn/)(<span style="color: rgb(243,121,52);">react路由,4.x的版本,如果还使用3.x的版本,请切换分支(ps:分支不再维护)</span>)
29-
- [redux](https://redux.js.org/)(基础用法,但是封装了通用action和reducer,demo中主要用于权限控制(ps:目前可以用16.x的context api代替),可以简单了解下)
30-
- [antd](https://ant.design/index-cn)(<span style="color: rgb(243,121,52);">蚂蚁金服开源的react ui组件框架</span>)
31-
- [axios](https://github.com/mzabriskie/axios)(<span style="color: rgb(243,121,52);">http请求模块,可用于前端任何场景,很强大👍</span>)
32-
- [echarts-for-react](https://github.com/hustcc/echarts-for-react)(<span style="color: rgb(243,121,52);">可视化图表,别人基于react对echarts的封装,足够用了</span>)
33-
- [recharts](http://recharts.org/#/zh-CN/)(<span style="color: rgb(243,121,52);">另一个基于react封装的图表,个人觉得是没有echarts好用</span>)
34-
- [nprogress](https://github.com/rstacruz/nprogress)(<span style="color: rgb(243,121,52);">顶部加载条,蛮好用👍</span>)
35-
- [react-draft-wysiwyg](https://github.com/jpuri/react-draft-wysiwyg)(<span style="color: rgb(243,121,52);">别人基于react的富文本封装,如果找到其他更好的可以替换</span>)
36-
- [react-draggable](https://github.com/mzabriskie/react-draggable)(<span style="color: rgb(243,121,52);">拖拽模块,找了个简单版的</span>)
37-
- [screenfull](https://github.com/sindresorhus/screenfull.js/)(<span style="color: rgb(243,121,52);">全屏插件</span>)
38-
- [photoswipe](https://github.com/dimsemenov/photoswipe)(<span style="color: rgb(243,121,52);">图片弹层查看插件,不依赖jQuery,还是蛮好用👍</span>)
39-
- [animate.css](http://daneden.me/animate)(<span style="color: rgb(243,121,52);">css动画库</span>)
40-
- [react-loadable](https://github.com/jamiebuilds/react-loadable)(代码拆分,按需加载,预加载,样样都行,具体见其文档,推荐使用)
41-
- [redux-alita](https://github.com/yezihaohao/redux-alita) 极简的redux2react工具
42-
- 其他小细节省略
35+
36+
<span style="color: rgb(184,49,47);">项目是用 create-react-app 创建的,主要还是列出新加的功能依赖包</span>
37+
38+
<span style="color: rgb(184,49,47);">点击名称可跳转相关网站 😄😄</span>
39+
40+
- [react](https://facebook.github.io/react/)
41+
- [react-router](https://react-guide.github.io/react-router-cn/)(<span style="color: rgb(243,121,52);">react 路由,4.x 的版本,如果还使用 3.x 的版本,请切换分支(ps:分支不再维护)</span>)
42+
- [redux](https://redux.js.org/)(基础用法,但是封装了通用 action 和 reducer,demo 中主要用于权限控制(ps:目前可以用 16.x 的 context api 代替),可以简单了解下)
43+
- [antd](https://ant.design/index-cn)(<span style="color: rgb(243,121,52);">蚂蚁金服开源的 react ui 组件框架</span>)
44+
- [axios](https://github.com/mzabriskie/axios)(<span style="color: rgb(243,121,52);">http 请求模块,可用于前端任何场景,很强大 👍</span>)
45+
- [echarts-for-react](https://github.com/hustcc/echarts-for-react)(<span style="color: rgb(243,121,52);">可视化图表,别人基于 react 对 echarts 的封装,足够用了</span>)
46+
- [recharts](http://recharts.org/#/zh-CN/)(<span style="color: rgb(243,121,52);">另一个基于 react 封装的图表,个人觉得是没有 echarts 好用</span>)
47+
- [nprogress](https://github.com/rstacruz/nprogress)(<span style="color: rgb(243,121,52);">顶部加载条,蛮好用 👍</span>)
48+
- [react-draft-wysiwyg](https://github.com/jpuri/react-draft-wysiwyg)(<span style="color: rgb(243,121,52);">别人基于 react 的富文本封装,如果找到其他更好的可以替换</span>)
49+
- [react-draggable](https://github.com/mzabriskie/react-draggable)(<span style="color: rgb(243,121,52);">拖拽模块,找了个简单版的</span>)
50+
- [screenfull](https://github.com/sindresorhus/screenfull.js/)(<span style="color: rgb(243,121,52);">全屏插件</span>)
51+
- [photoswipe](https://github.com/dimsemenov/photoswipe)(<span style="color: rgb(243,121,52);">图片弹层查看插件,不依赖 jQuery,还是蛮好用 👍</span>)
52+
- [animate.css](http://daneden.me/animate)(<span style="color: rgb(243,121,52);">css 动画库</span>)
53+
- [react-loadable](https://github.com/jamiebuilds/react-loadable)(代码拆分,按需加载,预加载,样样都行,具体见其文档,推荐使用)
54+
- [redux-alita](https://github.com/yezihaohao/redux-alita) 极简的 redux2react 工具
55+
- 其他小细节省略
4356

4457
### 功能模块
45-
<span style="color: rgb(184,49,47);">备注:项目只引入了ant-design的部分组件,其他的组件antd官网有源码,可以直接复制到项目中使用,后续有时间补上全部组件。</span>
4658

47-
<span style="color: rgb(184,49,47);">项目使用了antd的自定义主题功能-->黑色,若想替换其他颜色,具体操作请查看antd官网</span>
59+
<span style="color: rgb(184,49,47);">备注:项目只引入了 ant-design 的部分组件,其他的组件 antd 官网有源码,可以直接复制到项目中使用,后续有时间补上全部组件。</span>
60+
61+
<span style="color: rgb(184,49,47);">项目使用了 antd 的自定义主题功能-->黑色,若想替换其他颜色,具体操作请查看 antd 官网</span>
62+
4863
<!--more-->
4964

50-
- 首页
51-
- 完整布局
52-
- 换肤(全局功能,暂时只实现了顶部导航的换肤,后续加上其他模块)
53-
- 导航菜单
54-
- 顶部导航(菜单伸缩,全屏功能)
55-
- 左边菜单(增加滚动条以及适配路由的active操作)
56-
- UI模块
57-
- 按钮(antd组件)
58-
- 图标(antd组件并增加彩色表情符)
59-
- 加载中(antd组件并增加顶部加载条)
60-
- 通知提醒框(antd组件)
61-
- 标签页(antd组件)
62-
- 轮播图(ant动效组件)
63-
- 富文本
64-
- 拖拽
65-
- 画廊
66-
- 动画
67-
- 基础动画(animate.css所有动画)
68-
- 动画案例
69-
- 表格
70-
- 基础表格(antd组件)
71-
- 高级表格(antd组件)
72-
- 异步表格(数据来自掘金酱的接口)
73-
- 表单
74-
- 基础表单(antd组件)
75-
- 图表
76-
- echarts图表
77-
- recharts图表
78-
- 页面
79-
- 登录页面(包括GitHub第三方登录)
80-
- 404页面
65+
- 首页
66+
- 完整布局
67+
- 换肤(全局功能,暂时只实现了顶部导航的换肤,后续加上其他模块)
68+
- 导航菜单
69+
- 顶部导航(菜单伸缩,全屏功能)
70+
- 左边菜单(增加滚动条以及适配路由的 active 操作)
71+
- UI 模块
72+
- 按钮(antd 组件)
73+
- 图标(antd 组件并增加彩色表情符)
74+
- 加载中(antd 组件并增加顶部加载条)
75+
- 通知提醒框(antd 组件)
76+
- 标签页(antd 组件)
77+
- 轮播图(ant 动效组件)
78+
- 富文本
79+
- 拖拽
80+
- 画廊
81+
- 动画
82+
- 基础动画(animate.css 所有动画)
83+
- 动画案例
84+
- 表格
85+
- 基础表格(antd 组件)
86+
- 高级表格(antd 组件)
87+
- 异步表格(数据来自掘金酱的接口)
88+
- 表单
89+
- 基础表单(antd 组件)
90+
- 图表
91+
- echarts 图表
92+
- recharts 图表
93+
- 页面
94+
- 登录页面(包括 GitHub 第三方登录)
95+
- 404 页面
8196

8297
### 功能截图
98+
8399
#### 首页
100+
84101
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd1.gif)
102+
85103
#### 按钮图标等
104+
86105
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd2.gif)
106+
87107
#### 轮播图
108+
88109
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd3.gif)
110+
89111
#### 富文本
112+
90113
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd4.gif)
114+
91115
#### 拖拽
116+
92117
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd5.gif)
118+
93119
#### 画廊
120+
94121
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd6.gif)
122+
95123
#### 动画
124+
96125
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd7.gif)
126+
97127
#### 表格
128+
98129
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd8.gif)
130+
99131
#### 表单
132+
100133
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd9.gif)
134+
101135
#### 图表
136+
102137
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd10.gif)
138+
103139
#### 页面
140+
104141
![截图](https://raw.githubusercontent.com/yezihaohao/yezihaohao.github.io/master/imgs/rd11.gif)
142+
105143
#### 菜单拖拽
144+
106145
![截图](https://raw.githubusercontent.com/yezihaohao/react-admin/master/screenshots/menu_draggable.gif)
107146

108147
### 代码目录
148+
109149
```js
110150
+-- build/ ---打包的文件目录
111151
+-- config/ ---npm run eject 后的配置文件目录
@@ -144,42 +184,57 @@ react-admin system solution
144184
--- .eslintrc ---自定义eslint配置文件,包括增加的react jsx语法限制
145185
--- package.json
146186
```
187+
147188
### 安装运行
189+
148190
##### 1.下载或克隆项目源码
149-
##### 2.yarn 或者 npm安装相关包文件(首先推荐使用yarn,国内建议增加淘宝镜像源,不然很慢,你懂的😁)
150-
> 有些老铁遇到运行时报错,首先确定下是不是最新稳定版的nodejs和npm或者yarn(推荐用yarn),切记不要用cnpn
191+
192+
##### 2.yarn 或者 npm 安装相关包文件(首先推荐使用 yarn,国内建议增加淘宝镜像源,不然很慢,你懂的 😁)
193+
194+
> 有些老铁遇到运行时报错,首先确定下是不是最新稳定版的 nodejs 和 npm 或者 yarn(推荐用 yarn),切记不要用 cnpn
151195
152196
```js
153197
// 首推荐使用yarn装包
154198
yarn or npm i
155199
```
200+
156201
##### 3.启动项目
202+
157203
```js
158204
yarn start or npm start
159205
```
206+
160207
##### 4.打包项目
208+
161209
```js
162210
yarn build or npm run build
163211
```
164212

165213
### Q&A(点击问题查看答案)
166-
#### 1.[create-react-app 打包项目run build 增加进度条信息?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-325383346)
214+
215+
#### 1.[create-react-app 打包项目 run build 增加进度条信息?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-325383346)
216+
167217
#### 2.[接口跨域了,怎么在本地开发时配置代理?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-326169055)
168-
#### 3.[在使用hashRouter的情况下怎么实现类似锚点跳转?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-345127221)
218+
219+
#### 3.[在使用 hashRouter 的情况下怎么实现类似锚点跳转?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-345127221)
220+
169221
#### 4.[怎么添加多页面配置?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-348088852)
222+
170223
#### 5.[路由传参数接问号怎么传?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-375583089)
171-
#### 6.[如何兼容IE浏览器?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-510295292)
224+
225+
#### 6.[如何兼容 IE 浏览器?](https://github.com/yezihaohao/react-admin/issues/12#issuecomment-510295292)
172226

173227
### 结尾
228+
174229
该项目会不定时更新,后续时间会添加更多的模块
175230

176-
欢迎和感谢大家PR~~👏👏
231+
欢迎和感谢大家 PR~~👏👏
177232

178-
若有问题,可加QQ群与我交流
233+
若有问题,可加 QQ 群与我交流
179234

180-
- 1群:264591039(已满)
181-
- 2群:592688854(已满)
182-
- 3群:743490497 (已满)
183-
- 4群:150131600
235+
- 1 群:264591039(已满)
236+
- 2 群:592688854(已满)
237+
- 3 群:743490497 (已满)
238+
- 4 群:150131600
184239

185-
如果对你有帮助,给个star哟~~❤️❤️❤️❤️
240+
如果对你有帮助,给个 star 哟~~❤️❤️❤️❤️

0 commit comments

Comments
 (0)