docs: improve event param typing

This commit is contained in:
陈嘉涵 2020-02-09 11:12:15 +08:00
parent 779c83bd67
commit aceaa2f739
40 changed files with 84 additions and 84 deletions

View File

@ -153,7 +153,7 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| select | Triggered when click option | item, index |
| select | Triggered when click option | *action: Action, index: number* |
| cancel | Triggered when cancel click | - |
| click-overlay | Triggered when click overlay | - |
| open | Triggered when open ActionSheet | - |

View File

@ -169,7 +169,7 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| select | 选中选项时触发,禁用或加载状态下不会触发 | item: 选项对应的对象, index: 选择对应的索引 |
| select | 选中选项时触发,禁用或加载状态下不会触发 | *action: Action, index: number* |
| cancel | 取消按钮点击时触发 | - |
| click-overlay | 点击遮罩层时触发 | - |
| open | 打开菜单时触发 | - |

View File

@ -125,5 +125,5 @@ Vue.use(Button);
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click button and not disabled or loading | event: Event |
| touchstart | Triggered when touch start | event: TouchEvent |
| click | Triggered when click button and not disabled or loading | *event: Event* |
| touchstart | Triggered when touch start | *event: TouchEvent* |

View File

@ -148,5 +148,5 @@ Vue.use(Button);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击按钮,且按钮状态不为加载或禁用时触发 | event: Event |
| touchstart | 开始触摸按钮时触发 | event: TouchEvent |
| click | 点击按钮,且按钮状态不为加载或禁用时触发 | *event: Event* |
| touchstart | 开始触摸按钮时触发 | *event: TouchEvent* |

View File

@ -249,8 +249,8 @@ Set `poppable` to `false`, the calendar will be displayed directly on the page i
| Event | Description | Arguments |
|------|------|------|
| select | Triggered when select date | value: Date \| Date[] |
| confirm | Triggered after date selection is completeif `show-confirm` is` true`, it is triggered after clicking the confirm button | value: Date \| Date[] |
| select | Triggered when select date | *value: Date \| Date[]* |
| confirm | Triggered after date selection is completeif `show-confirm` is` true`, it is triggered after clicking the confirm button | *value: Date \| Date[]* |
### Slots

View File

@ -251,8 +251,8 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| select | 点击任意日期时触发 | value: Date \| Date[] |
| confirm | 日期选择完成后触发,若`show-confirm``true`,则点击确认按钮后触发 | value: Date \| Date[] |
| select | 点击任意日期时触发 | *value: Date \| Date[]* |
| confirm | 日期选择完成后触发,若`show-confirm``true`,则点击确认按钮后触发 | *value: Date \| Date[]* |
### Slots

View File

@ -82,8 +82,8 @@ Use slot to custom content.
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click-thumb | Triggered when thumb clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
| click-thumb | Triggered when thumb clicked | *event: Event* |
### Slots

View File

@ -84,8 +84,8 @@ Vue.use(Card);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click-thumb | 点击自定义图片时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
| click-thumb | 点击自定义图片时触发 | *event: Event* |
### Slots

View File

@ -137,7 +137,7 @@ Vue.use(CellGroup);
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click cell | event: Event |
| click | Triggered when click cell | *event: Event* |
### CellGroup Slots

View File

@ -148,7 +148,7 @@ Vue.use(CellGroup);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击单元格时触发 | event: Event |
| click | 点击单元格时触发 | *event: Event* |
### CellGroup Slots

View File

@ -112,10 +112,10 @@ Setting `type` to `flex` to enable flex layout
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click row | event: Event |
| click | Triggered when click row | *event: Event* |
### Col Events
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click col | event: Event |
| click | Triggered when click col | *event: Event* |

View File

@ -115,10 +115,10 @@ Layout 组件提供了`24列栅格`,通过在`Col`上添加`span`属性设置
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
### Col Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |

View File

@ -145,7 +145,7 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
### ContactList Props

View File

@ -149,7 +149,7 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
### ContactList Props

View File

@ -130,15 +130,15 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| finish | Triggered when count down finished | - |
| change `v2.4.4` | Triggered when count down changed | timeData |
| change `v2.4.4` | Triggered when count down changed | *timeData: TimeData* |
### Slots
| Name | Description | SlotProps |
|------|------|------|
| default | Custom Content | timeData |
| default | Custom Content | *timeData: TimeData* |
### timeData Structure
### TimeData Structure
| Name | Description | Type |
|------|------|------|

View File

@ -140,15 +140,15 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| finish | 倒计时结束时触发 | - |
| change `v2.4.4` | 倒计时变化时触发 | timeData |
| change `v2.4.4` | 倒计时变化时触发 | *timeData: TimeData* |
### Slots
| 名称 | 说明 | SlotProps |
|------|------|------|
| default | 自定义内容 | timeData |
| default | 自定义内容 | *timeData: TimeData* |
### timeData 格式
### TimeData 格式
| 名称 | 说明 | 类型 |
|------|------|------|

View File

@ -249,13 +249,13 @@ Field support all native events of input tag
| Event | Description | Parameters |
|------|------|------|
| input | Triggered when input value changed | value: current value |
| focus | Triggered when input gets focus | event: Event |
| blur | Triggered when input loses focus | event: Event |
| clear | Triggered when click clear icon | event: Event |
| click | Triggered when click Field | event: Event |
| click-left-icon | Triggered when click the left icon of Field | event: Event |
| click-right-icon | Triggered when click the right icon of Field | event: Event |
| input | Triggered when input value changed | *value: string* |
| focus | Triggered when input gets focus | *event: Event* |
| blur | Triggered when input loses focus | *event: Event* |
| clear | Triggered when click clear icon | *event: Event* |
| click | Triggered when click Field | *event: Event* |
| click-left-icon | Triggered when click the left icon of Field | *event: Event* |
| click-right-icon | Triggered when click the right icon of Field | *event: Event* |
### Methods

View File

@ -268,13 +268,13 @@ export default {
| 事件 | 说明 | 回调参数 |
|------|------|------|
| input | 输入框内容变化时触发 | value: 输入框当前值 |
| focus | 输入框获得焦点时触发 | event: Event |
| blur | 输入框失去焦点时触发 | event: Event |
| clear | 点击清除按钮时触发 | event: Event |
| click | 点击时触发 | event: Event |
| click-left-icon | 点击左侧图标时触发 | event: Event |
| click-right-icon | 点击右侧图标时触发 | event: Event |
| input | 输入框内容变化时触发 | *value: string (当前输入的值)* |
| focus | 输入框获得焦点时触发 | *event: Event* |
| blur | 输入框失去焦点时触发 | *event: Event* |
| clear | 点击清除按钮时触发 | *event: Event* |
| click | 点击时触发 | *event: Event* |
| click-left-icon | 点击左侧图标时触发 | *event: Event* |
| click-right-icon | 点击右侧图标时触发 | *event: Event* |
### 方法

View File

@ -126,7 +126,7 @@ Vue.use(GridItem);
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
### GridItem Slots

View File

@ -144,7 +144,7 @@ Vue.use(GridItem);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击格子时触发 | event: Event |
| click | 点击格子时触发 | *event: Event* |
### GridItem Slots

View File

@ -97,4 +97,4 @@ import 'vant/lib/icon/local.css';
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click icon | event: Event |
| click | Triggered when click icon | *event: Event* |

View File

@ -103,4 +103,4 @@ import 'vant/lib/icon/local.css';
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击图标时触发 | event: Event |
| click | 点击图标时触发 | *event: Event* |

View File

@ -96,7 +96,7 @@ Vue.use(Lazyload);
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click image | event: Event |
| click | Triggered when click image | *event: Event* |
| load | Triggered when image loaded | - |
| error | Triggered when image load failed | - |

View File

@ -128,7 +128,7 @@ Vue.use(Lazyload);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击图片时触发 | event: Event |
| click | 点击图片时触发 | *event: Event* |
| load | 图片加载完毕时触发 | - |
| error | 图片加载失败时触发 | - |

View File

@ -77,8 +77,8 @@ Vue.use(NoticeBar);
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click NoticeBar | event: Event |
| close | Triggered when closed | event: Event |
| click | Triggered when click NoticeBar | *event: Event* |
| close | Triggered when closed | *event: Event* |
### Slots

View File

@ -85,8 +85,8 @@ Vue.use(NoticeBar);
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击通知栏时触发 | event: Event |
| close | 关闭通知栏时触发 | event: Event |
| click | 点击通知栏时触发 | *event: Event* |
| close | 关闭通知栏时触发 | *event: Event* |
### Slots

View File

@ -69,7 +69,7 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
### Slots

View File

@ -75,7 +75,7 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
### Slots

View File

@ -139,7 +139,7 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when click Popup | event: Event |
| click | Triggered when click Popup | *event: Event* |
| open | Triggered when open Popup | - |
| opened | Triggered when opened Popup | - |
| close | Triggered when close Popup | - |

View File

@ -150,7 +150,7 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击弹出层时触发 | event: Event |
| click | 点击弹出层时触发 | *event: Event* |
| open | 打开弹出层时触发 | - |
| opened | 打开弹出层且动画结束后触发 | - |
| close | 关闭弹出层时触发 | - |

View File

@ -135,11 +135,11 @@ Use `action` slot to custom right button, `cancel` event will no longer be trigg
| Event | Description | Arguments |
|------|------|------|
| search | Triggered when confirm search | value: current value |
| input | Triggered when input value changed | value: current value |
| focus | Triggered when input gets focus | event: Event |
| blur | Triggered when input loses focus | event: Event |
| clear | Triggered when click clear icon | event: Event |
| search | Triggered when confirm search | *value: string* |
| input | Triggered when input value changed | *value: string* |
| focus | Triggered when input gets focus | *event: Event* |
| blur | Triggered when input loses focus | *event: Event* |
| clear | Triggered when click clear icon | *event: Event* |
| cancel | Triggered when click cancel button | - |
### Slots

View File

@ -135,11 +135,11 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| search | 确定搜索时触发 | value: 输入框当前值 |
| input | 输入框内容变化时触发 | value: 输入框当前值 |
| focus | 输入框获得焦点时触发 | event: Event |
| blur | 输入框失去焦点时触发 | event: Event |
| clear | 点击清除按钮后触发 | event: Event |
| search | 确定搜索时触发 | *value: string (当前输入的值)* |
| input | 输入框内容变化时触发 | *value: string (当前输入的值)* |
| focus | 输入框获得焦点时触发 | *event: Event* |
| blur | 输入框失去焦点时触发 | *event: Event* |
| clear | 点击清除按钮后触发 | *event: Event* |
| cancel | 点击取消按钮时触发 | - |
### Slots

View File

@ -130,9 +130,9 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| change | Triggered when value change | value: current value, detail: Detail info, contains name |
| change | Triggered when value change | *value: string, detail: { name: string }* |
| overlimit | Triggered when click disabled button | - |
| plus | Triggered when click plus button | - |
| minus | Triggered when click minus button | - |
| focus | Triggered when input focused | event: Event |
| blur | Triggered when input blured | event: Event |
| focus | Triggered when input focused | *event: Event* |
| blur | Triggered when input blured | *event: Event* |

View File

@ -131,7 +131,7 @@ export default {
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| v-model | 当前输入值 | *number \| string* | - |
| v-model | 当前输入值 | *number \| string* | - |
| min | 最小值 | *number \| string* | `1` |
| max | 最大值 | *number \| string* | - |
| default-value | 初始值,当 v-model 为空时生效 | *number \| string* | `1` |
@ -154,9 +154,9 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| change | 当绑定值变化时触发的事件 | value: 当前组件的值, detail: 额外信息,包含 name 的字段 |
| change | 当绑定值变化时触发的事件 | *value: string, detail: { name: string }* |
| overlimit | 点击不可用的按钮时触发 | - |
| plus | 点击增加按钮时触发 | - |
| minus | 点击减少按钮时触发 | - |
| focus | 输入框聚焦时触发 | event: Event |
| blur | 输入框失焦时触发 | event: Event |
| focus | 输入框聚焦时触发 | *event: Event* |
| blur | 输入框失焦时触发 | *event: Event* |

View File

@ -170,7 +170,7 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
### Swipe Methods

View File

@ -176,7 +176,7 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
### Swipe 方法

View File

@ -91,7 +91,7 @@ export default {
| Attribute | Description | Type | Default |
|------|------|------|------|
| v-model | Check status of Switch | *any* | `false` |
| v-model | Check status of Switch | *ActiveValue \| InactiveValue* | `false` |
| loading | Whether to show loading icon | *boolean* | `false` |
| disabled | Whether to disable switch | *boolean* | `false` |
| size `v2.2.11` | Size of switch | *number \| string* | `30px` |
@ -104,5 +104,5 @@ export default {
| Event | Description | Parameters |
|------|------|------|
| change | Triggered when check status changed | checked: is switch checked |
| click `v2.2.11` | Triggered when clicked | event: Event |
| change | Triggered when check status changed | *value: any* |
| click `v2.2.11` | Triggered when clicked | *event: Event* |

View File

@ -109,12 +109,12 @@ export default {
| size `v2.2.11` | 开关尺寸,默认单位为`px` | *number \| string* | `30px` |
| active-color | 打开时的背景色 | *string* | `#1989fa` |
| inactive-color | 关闭时的背景色 | *string* | `white` |
| active-value | 打开时的值 | *any* | `true` |
| inactive-value | 关闭时的值 | *any* | `false` |
| active-value | 打开时对应的值 | *any* | `true` |
| inactive-value | 关闭时对应的值 | *any* | `false` |
### Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| change | 开关状态切换回调 | checked: 是否选中开关 |
| click `v2.2.11` | 点击时触发 | event: Event |
| change | 开关状态切换时触发 | *value: any* |
| click `v2.2.11` | 点击时触发 | *event: Event* |

View File

@ -135,5 +135,5 @@ export default {
| Event | Description | Arguments |
|------|------|------|
| click | Triggered when clicked | event: Event |
| click | Triggered when clicked | *event: Event* |
| close | Triggered when click close icon | - |

View File

@ -145,5 +145,5 @@ export default {
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | event: Event |
| click | 点击时触发 | *event: Event* |
| close | 关闭标签时触发 | - |