Skip to content

Commit aa2db7a

Browse files
committed
docs: refact via vuepress
1 parent 073d8f7 commit aa2db7a

22 files changed

+3187
-15
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ package-lock.json
1313
.next/
1414
examples/**/.umi
1515
examples/**/.umi-production
16-
16+
/website/build
17+
yarn.lock

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2018 ChenCheng ([email protected])
3+
Copyright (c) 2016-present ChenCheng ([email protected])
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,18 @@ Want more?
7878
* 在 gitc 分享 dva 的 PPT :[React 应用框架在蚂蚁金服的实践](http://slides.com/sorrycc/dva)
7979
* 如果还在用 [email protected],请尽快 [升级到 2.x](https://github.com/sorrycc/blog/issues/48)
8080

81-
## Community(中文)
81+
## Community
8282

83-
> 之前在 dvaantdpro 1、2 群的请勿重复加入。
83+
### 微信群
8484

85-
<img src="https://gw.alipayobjects.com/zos/rmsportal/WdeuPFPzlKkfEWtxxeGL.jpg" width="200" />
85+
<img src="https://gw.alipayobjects.com/zos/rmsportal/QwuMhmBXFuAqYvzktiGk.png" width="60" />
86+
87+
注:群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入。
88+
89+
### Telegram
90+
91+
[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)
8692

87-
扫码加微信群。(群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入)
8893

8994
## License
9095

README_zh-CN.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@
8181

8282
## 社区
8383

84-
> 之前在 dvaantdpro 1、2 群的请勿重复加入。
84+
### 微信群
8585

86-
<img src="https://gw.alipayobjects.com/zos/rmsportal/WdeuPFPzlKkfEWtxxeGL.jpg" width="200" />
86+
群满 100 人,可加 `sorryccpro` 备注 `dva` 邀请加入。
8787

88-
扫码加微信群。(群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入)
88+
### Telegram
89+
90+
[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)
8991

9092
## License
9193

docs/.vuepress/config.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
title: 'DvaJS',
3+
description: 'React and redux based, lightweight and elm-style framework.',
4+
themeConfig: {
5+
repo: 'dvajs/dva',
6+
lastUpdated: 'Last Updated',
7+
editLinks: true,
8+
editLinkText: '在 GitHub 上编辑此页',
9+
docsDir: 'docs',
10+
nav: [
11+
{ text: '指南', link: '/guide/' },
12+
{ text: 'API', link: '/api/' },
13+
{ text: '知识地图', link: '/knowledgemap/' },
14+
{ text: '发布日志', link: 'https://github.com/dvajs/dva/releases' },
15+
],
16+
sidebar: {
17+
'/guide/': [
18+
{
19+
title: '指南',
20+
collapsable: false,
21+
children: [
22+
'',
23+
'getting-started',
24+
'examples-and-boilerplates',
25+
'concepts',
26+
'introduce-class',
27+
],
28+
},
29+
{
30+
title: '社区',
31+
collapsable: false,
32+
children: ['fig-show', 'develop-complex-spa', 'source-code-explore'],
33+
},
34+
],
35+
'/api/': [''],
36+
'/knowledgemap/': [''],
37+
},
38+
},
39+
};

docs/.vuepress/override.styl

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$accentColor = #fc54c3
2+
$textColor = #2c3e50
3+
$borderColor = #eaecef
4+
$codeBgColor = #282c34

docs/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
home: true
3+
actionText: 快速上手 →
4+
actionLink: /guide/
5+
features:
6+
- title: 易学易用
7+
details: 仅有 6 个 api,对 redux 用户尤其友好,配合 umi 使用后更是降低为 0 API
8+
- title: elm 概念
9+
details: 通过 reducers, effects 和 subscriptions 组织 model,简化 redux 和 redux-saga 引入的概念
10+
- title: 插件机制
11+
details: 比如 dva-loading 可以自动处理 loading 状态,不用一遍遍地写 showLoading 和 hideLoading
12+
footer: MIT Licensed | Copyright © 2017-present
13+
---
14+
15+
### 社区
16+
17+
#### 微信群
18+
19+
<img src="https://gw.alipayobjects.com/zos/rmsportal/QwuMhmBXFuAqYvzktiGk.png" width="60" />
20+
21+
注:群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入。
22+
23+
#### Telegram
24+
25+
[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)

docs/API_zh-CN.md renamed to docs/api/README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# API
1+
---
2+
sidebarDepth: 2
3+
---
24

3-
[View this in English](./API.md)
5+
# API
46

57
## 输出文件
8+
69
### dva
710

811
默认输出文件。
@@ -50,6 +53,7 @@ const UserPageComponent = dynamic({
5053
* component:返回 Promise 的函数,Promise 返回 React Component
5154

5255
## dva API
56+
5357
### `app = dva(opts)`
5458

5559
创建应用,返回 dva 实例。(注:dva 支持多实例)

docs/guide/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 介绍
2+
3+
dva 首先是一个基于 [redux](https://github.com/reduxjs/redux)[redux-saga](https://github.com/redux-saga/redux-saga) 的数据流方案,然后为了简化开发体验,dva 还额外内置了 [react-router](https://github.com/ReactTraining/react-router)[fetch](https://github.com/github/fetch),所以也可以理解为一个轻量级的应用框架。
4+
5+
## 特性
6+
7+
* **易学易用**,仅有 6 个 api,对 redux 用户尤其友好,[配合 umi 使用](https://umijs.org/guide/with-dva.html)后更是降低为 0 API
8+
* **elm 概念**,通过 reducers, effects 和 subscriptions 组织 model
9+
* **插件机制**,比如 [dva-loading](https://github.com/dvajs/dva/tree/master/packages/dva-loading) 可以自动处理 loading 状态,不用一遍遍地写 showLoading 和 hideLoading
10+
* **支持 HMR**,基于 [babel-plugin-dva-hmr](https://github.com/dvajs/babel-plugin-dva-hmr) 实现 components、routes 和 models 的 HMR
11+
12+
## 他是如何工作的?
13+
14+
## 他是怎么来的?
15+
16+
* [Why dva and what's dva](https://github.com/dvajs/dva/issues/1)
17+
* [支付宝前端应用架构的发展和选择](https://www.github.com/sorrycc/blog/issues/6)
18+
19+
## 谁在用?
20+
21+
## 为什么不是...?
22+
23+
### redux
24+
### mobx
25+
26+
## 命名由来?
27+
28+
> D.Va拥有一部强大的机甲,它具有两台全自动的近距离聚变机炮、可以使机甲飞跃敌人或障碍物的推进器、 还有可以抵御来自正面的远程攻击的防御矩阵。
29+
30+
—— 来自 [守望先锋](http://ow.blizzard.cn/heroes/dva)
31+
32+
<img src="https://zos.alipayobjects.com/rmsportal/psagSCVHOKQVqqNjjMdf.jpg" width="200" height="200" />

docs/Concepts_zh-CN.md renamed to docs/guide/concepts.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Concepts
1+
---
2+
sidebarDepth: 2
3+
---
24

3-
[View this in English](./Concepts.md)
5+
# Dva 概念
46

57
## 数据流向
68

@@ -112,7 +114,7 @@ app.router(({history}) =>
112114

113115
所以在 dva 中,通常需要 connect Model的组件都是 Route Components,组织在`/routes/`目录下,而`/components/`目录下则是纯组件(Presentational Components)。
114116

115-
## 参考引申
117+
## 参考
116118

117119
- [redux docs](http://redux.js.org/docs/Glossary.html)
118120
- [redux docs 中文](http://cn.redux.js.org/index.html)

0 commit comments

Comments
 (0)