Skip to content

Commit ccf1598

Browse files
committedDec 24, 2015
Improve README
1 parent 9ec3dc6 commit ccf1598

File tree

1 file changed

+76
-80
lines changed

1 file changed

+76
-80
lines changed
 

‎README.md

+76-80
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,11 @@ DefaultButton(default-btn),可以通过两种方式引入:
4949
...
5050
```
5151

52-
支持属性:
53-
54-
* `outline`
55-
56-
设置该属性后,其背景颜色将变成透明
57-
* `size`
58-
52+
**props:**
53+
* `outline`: {boolean} - 设置该属性后,其背景颜色将变成透明
54+
* `size`: {string}
5955
- `small` - 小按钮(inline-block)
60-
61-
* `disabled` - 设置该属性后,其按钮变灰
56+
* `disabled`: {boolean} - 设置该属性后,其按钮变灰
6257

6358

6459
### Cell
@@ -91,10 +86,10 @@ import { Cell } from "weui-react-component";
9186
...
9287
<Cell>这是一个说明</Cell>
9388
```
89+
**props:**
9490

95-
* `header`
96-
97-
* `footer`
91+
* `header`: {string | ReactElement}
92+
* `footer`: {string | ReactElement}
9893

9994

10095
#### Link 组件
@@ -108,9 +103,9 @@ import { Link } from "weui-react-component";
108103
```
109104
like as `<a href="...">这是一个链接</a>`
110105

111-
* `header`
106+
* `header`: {string | ReactElement}
112107

113-
* `footer`
108+
* `footer`: {string | ReactElement}
114109

115110

116111
#### Input 组件
@@ -124,7 +119,9 @@ import { Input } from "weui-react-component";
124119
```
125120
like as `<label>Description</label><input type="text">`
126121

127-
* `label`
122+
**props:**
123+
124+
* `label`: {string}
128125

129126

130127
#### Checkbox 组件
@@ -138,11 +135,11 @@ import { Checkbox } from "weui-react-component";
138135
```
139136
like as `<label>Description></label><input type="checkbox">`
140137

141-
* `label`
142-
143-
* `checked`
138+
**props:**
144139

145-
* `defaultChecked`
140+
* `label`: {string}
141+
* `checked`: {boolean}
142+
* `defaultChecked`: {boolean}
146143

147144
#### Radio 组件
148145

@@ -175,9 +172,10 @@ like as
175172
</select>
176173
```
177174

178-
* `header`
175+
**props**
179176

180-
* `label`
177+
* `header`: {string | ReactElement}
178+
* `label`: {string}
181179

182180

183181
#### Switch 组件
@@ -190,9 +188,10 @@ import { Switch } from "weui-react-component";
190188
...
191189
```
192190

193-
* `checked`
191+
**props:**
194192

195-
* `defaultChecked`
193+
* `checked`: {boolean}
194+
* `defaultChecked`: {boolean}
196195

197196

198197
#### Textarea 组件
@@ -205,7 +204,9 @@ import { Textarea } from "weui-react-component";
205204
...
206205
```
207206

208-
* `value`
207+
**props:**
208+
209+
* `value`: {string}
209210

210211

211212

@@ -231,7 +232,9 @@ import { Toast } from "weui-react-component";
231232
<Toast icon={...}>已完成</Toast>
232233
```
233234

234-
* `open`
235+
**props:**
236+
237+
* `open`: {boolean}
235238

236239

237240
#### Loading 组件
@@ -244,7 +247,9 @@ import { Loading } from "weui-react-component";
244247
...
245248
```
246249

247-
* `open`
250+
**props:**
251+
252+
* `open`: {boolean}
248253

249254

250255
### Dialog
@@ -259,11 +264,11 @@ import { Alert } from "weui-react-component";
259264
...
260265
```
261266

262-
* `title`
263-
264-
* `open`
267+
**props:**
265268

266-
* `onConfirm`
269+
* `title`: {string}
270+
* `open`: {boolean}
271+
* `onConfirm`: {Function}
267272

268273

269274

@@ -276,13 +281,13 @@ import { Confirm } from "weui-react-component";
276281
<Confirm title="这是标题" onConfirm={...} onCancel={...}>内容...</Confirm>
277282
...
278283
```
279-
* `title`
280284

281-
* `open`
285+
**props**
282286

283-
* `onConfirm`
284-
285-
* `onCancel`
287+
* `title`: {string}
288+
* `open`: {boolean}
289+
* `onConfirm`: {Function}
290+
* `onCancel`: {Function}
286291

287292

288293
### Progress
@@ -295,13 +300,12 @@ import { Progress } from "weui-react-component";
295300
...
296301
```
297302

298-
* `value`
299-
300-
* `max`
301-
302-
* `onCancel`
303+
**props:**
303304

304-
* `canceled`
305+
* `value`: {number}
306+
* `max`: {number}
307+
* `onCancel`: {Function}
308+
* `canceled`: {boolean}
305309

306310

307311
### Msg Page
@@ -318,15 +322,13 @@ import { Msg } from "weui-react-component";
318322
...
319323
```
320324

321-
* `title`
325+
**props:**
322326

323-
* `icon`
324-
325-
* `more`
326-
327-
* `onConfirm`
328-
329-
* `onCancel`
327+
* `title`: {string}
328+
* `icon`: {ReactElement}
329+
* `more`: {string} - URL
330+
* `onConfirm`: {Function}
331+
* `onCancel`: {Function}
330332

331333

332334
### Article
@@ -359,36 +361,30 @@ import { ActionSheet } from "weui-react-component";
359361
...
360362
```
361363

362-
属性:
364+
**props:**
363365

364366
* `items`: {string[]}
365-
366-
* `onClick`: {(): (() => Promise<any>, () => Promise)}
367-
368-
有两个参数,两个参数都是返回 Promise 的函数,
369-
370-
```js
371-
onClick = function (getValue, cleanup) {
372-
getValue().then(function (val) {
373-
// val
374-
return cleanup();
375-
}).then(function () {
376-
// done
377-
});
378-
}
379-
```
380-
381-
* `onCancel`: {(): () => Promise}
382-
383-
有一个参数
384-
385-
```js
386-
onCancel = function (cleanup) {
387-
cleanup().then(function () {
388-
// done
389-
});
390-
}
391-
```
367+
* `onClick`: {`(() => Promise<any>, () => Promise) => void`}
368+
369+
```js
370+
onClick = function (getValue, cleanup) {
371+
getValue().then(function (val) {
372+
// val
373+
return cleanup();
374+
}).then(function () {
375+
// done
376+
});
377+
}
378+
```
379+
* `onCancel`: {`(() => Promise) => void`}
380+
381+
```js
382+
onCancel = function (cleanup) {
383+
cleanup().then(function () {
384+
// done
385+
});
386+
}
387+
```
392388

393389
### Icons
394390

@@ -400,10 +396,10 @@ import { Icon } from "weui-react-component";
400396
...
401397
```
402398

403-
属性:
399+
**props:**
404400

405-
* `type`: { blank, circle, download, info, safe-success, safe-warning,
406-
success, success-circle, success-no-circle, waiting, info-circle, cancle }
401+
* `type`: {string} - one of (blank, circle, download, info, safe-success, safe-warning,
402+
success, success-circle, success-no-circle, waiting, info-circle, cancle)
407403

408404

409405
## Develop

0 commit comments

Comments
 (0)