Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taroMeeting
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
taroMeeting
Commits
144bfde2
Commit
144bfde2
authored
Sep 25, 2018
by
王树冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
19710804
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
2018-09-25-15-50-45.png
img/2018-09-25-15-50-45.png
+0
-0
2018-09-25-15-51-45.png
img/2018-09-25-15-51-45.png
+0
-0
package.json
package.json
+2
-2
readme.md
readme.md
+41
-2
No files found.
img/2018-09-25-15-50-45.png
0 → 100644
View file @
144bfde2
120 KB
img/2018-09-25-15-51-45.png
0 → 100644
View file @
144bfde2
32.3 KB
package.json
View file @
144bfde2
{
"name"
:
"
demo
"
,
"name"
:
"
taro-kit
"
,
"version"
:
"1.0.0"
,
"private"
:
true
,
"description"
:
"
demo
"
,
"description"
:
"
taro kit
"
,
"main"
:
"index.js"
,
"scripts"
:
{
"build:weapp"
:
"taro build --type weapp"
,
...
...
readme.md
View file @
144bfde2
## 功能列表
[
*
]
增加createApiAction
[
*
]
封装api请求方式
*
[
] 封装api请求方式
*
[
] 更方便的创建action:增加createApiAction
*
[
] 基础像素试着为1倍即:1px 会编译成 2rpx(小程序默认是2倍)符合习惯
*
[
] 基础demo案列
#### 更方面的创建action
> 未封装前
```
function articleList(data) {
return { type: LIST, payload: data }
}
export function list() {
console.log('list')
return (dispatch) => {
// service.get('/v1/article/list')
// .then((res) => {
// dispatch(articleList(res.data.article))
// })
Taro.request({
url: 'http://api.shudong.wang/v1/article/list',
data: {
foo: 'foo',
bar: 10
},
header: {
'content-type': 'application/json'
}
}).then((res) => {
dispatch(articleList(res.data.article))
})
}
}
```
![
2018-09-25-15-50-45
](
http://file.shudong.wang/2018-09-25-15-50-45.png
)
> 封装后请求api的使用方式
```
export const list = createApiAction(LIST, params => api.get('news/list', params))
```
![
2018-09-25-15-51-45
](
http://file.shudong.wang/2018-09-25-15-51-45.png
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment