mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
docs: improve click event typing (#8106)
This commit is contained in:
parent
8c58097121
commit
dcef90a2a3
@ -33,8 +33,8 @@ Vue.use(DemoButton);
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | ------------ |
|
||||
| click | 点击时触发 | event: Event |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -33,8 +33,8 @@ Vue.use(DemoButton);
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | ------------ |
|
||||
| click | 点击时触发 | event: Event |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -132,7 +132,7 @@ app.use(Button);
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| --- | --- | --- |
|
||||
| click | Emitted when button is clicked and not disabled or loading | _event: Event_ |
|
||||
| click | Emitted when button is clicked and not disabled or loading | _event: MouseEvent_ |
|
||||
| touchstart | Emitted when button is touched | _event: TouchEvent_ |
|
||||
|
||||
### Slots
|
||||
|
@ -159,7 +159,7 @@ app.use(Button);
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ---------- | ---------------------------------------- | ------------------- |
|
||||
| click | 点击按钮,且按钮状态不为加载或禁用时触发 | _event: Event_ |
|
||||
| click | 点击按钮,且按钮状态不为加载或禁用时触发 | _event: MouseEvent_ |
|
||||
| touchstart | 开始触摸按钮时触发 | _event: TouchEvent_ |
|
||||
|
||||
### Slots
|
||||
|
@ -82,9 +82,9 @@ Use slot to custom content.
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----------- | --------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| click-thumb | Emitted when thumb is clicked | _event: Event_ |
|
||||
| ----------- | --------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
| click-thumb | Emitted when thumb is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -88,9 +88,9 @@ app.use(Card);
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ----------- | -------------------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| click-thumb | 点击自定义图片时触发 | _event: Event_ |
|
||||
| ----------- | -------------------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
| click-thumb | 点击自定义图片时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -155,8 +155,8 @@ app.use(CellGroup);
|
||||
### Cell Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ---------------------------- | -------------- |
|
||||
| click | Emitted when cell is clicked | _event: Event_ |
|
||||
| ----- | ---------------------------- | ------------------- |
|
||||
| click | Emitted when cell is clicked | _event: MouseEvent_ |
|
||||
|
||||
### CellGroup Slots
|
||||
|
||||
|
@ -162,8 +162,8 @@ app.use(CellGroup);
|
||||
### Cell Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------------- | -------------- |
|
||||
| click | 点击单元格时触发 | _event: Event_ |
|
||||
| ------ | ---------------- | ------------------- |
|
||||
| click | 点击单元格时触发 | _event: MouseEvent_ |
|
||||
|
||||
### CellGroup Slots
|
||||
|
||||
|
@ -265,9 +265,9 @@ export default {
|
||||
### Checkbox Events
|
||||
|
||||
| Event | Description | Parameters |
|
||||
| ------ | ------------------------------------ | ------------------ |
|
||||
| ------ | ------------------------------------ | ------------------- |
|
||||
| change | Emitted when value changed | _checked: boolean_ |
|
||||
| click | Emitted when the checkbox is clicked | _event: Event_ |
|
||||
| click | Emitted when the checkbox is clicked | _event: MouseEvent_ |
|
||||
|
||||
### CheckboxGroup Events
|
||||
|
||||
|
@ -287,9 +287,9 @@ export default {
|
||||
### Checkbox Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ------------------------ | ------------------ |
|
||||
| ------ | ------------------------ | ------------------- |
|
||||
| change | 当绑定值变化时触发的事件 | _checked: boolean_ |
|
||||
| click | 点击复选框时触发 | _event: Event_ |
|
||||
| click | 点击复选框时触发 | _event: MouseEvent_ |
|
||||
|
||||
### CheckboxGroup Events
|
||||
|
||||
|
@ -101,11 +101,11 @@ Set grid spacing using `gutter` attribute. The default value is 0.
|
||||
### Row Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ------------------------------- | -------------- |
|
||||
| click | Emitted when the row is clicked | _event: Event_ |
|
||||
| ----- | ------------------------------- | ------------------- |
|
||||
| click | Emitted when the row is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Col Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ------------------------------- | -------------- |
|
||||
| click | Emitted when the col is clicked | _event: Event_ |
|
||||
| ----- | ------------------------------- | ------------------- |
|
||||
| click | Emitted when the col is clicked | _event: MouseEvent_ |
|
||||
|
@ -106,11 +106,11 @@ Layout 组件提供了 `24列栅格`,通过在 `Col` 上添加 `span` 属性
|
||||
### Row Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Col Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
@ -87,8 +87,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | --------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| ----- | --------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Less Variables
|
||||
|
||||
|
@ -86,8 +86,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### 样式变量
|
||||
|
||||
|
@ -276,11 +276,11 @@ Field support all native events of input tag
|
||||
| update:model-value | Emitted when input value changed | _value: string_ |
|
||||
| focus | Emitted when input is focused | _event: Event_ |
|
||||
| blur | Emitted when input is blured | _event: Event_ |
|
||||
| clear | Emitted when the clear icon is clicked | _event: Event_ |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| click-input | Emitted when the input is clicked | _event: Event_ |
|
||||
| click-left-icon | Emitted when the left icon is clicked | _event: Event_ |
|
||||
| click-right-icon | Emitted when the right icon is clicked | _event: Event_ |
|
||||
| clear | Emitted when the clear icon is clicked | _event: MouseEvent_ |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
| click-input | Emitted when the input is clicked | _event: MouseEvent_ |
|
||||
| click-left-icon | Emitted when the left icon is clicked | _event: MouseEvent_ |
|
||||
| click-right-icon | Emitted when the right icon is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Methods
|
||||
|
||||
|
@ -297,11 +297,11 @@ export default {
|
||||
| update:model-value | 输入框内容变化时触发 | _value: string (当前输入的值)_ |
|
||||
| focus | 输入框获得焦点时触发 | _event: Event_ |
|
||||
| blur | 输入框失去焦点时触发 | _event: Event_ |
|
||||
| clear | 点击清除按钮时触发 | _event: Event_ |
|
||||
| click | 点击 Field 时触发 | _event: Event_ |
|
||||
| click-input | 点击输入区域时触发 | _event: Event_ |
|
||||
| click-left-icon | 点击左侧图标时触发 | _event: Event_ |
|
||||
| click-right-icon | 点击右侧图标时触发 | _event: Event_ |
|
||||
| clear | 点击清除按钮时触发 | _event: MouseEvent_ |
|
||||
| click | 点击 Field 时触发 | _event: MouseEvent_ |
|
||||
| click-input | 点击输入区域时触发 | _event: MouseEvent_ |
|
||||
| click-left-icon | 点击左侧图标时触发 | _event: MouseEvent_ |
|
||||
| click-right-icon | 点击右侧图标时触发 | _event: MouseEvent_ |
|
||||
|
||||
### 方法
|
||||
|
||||
|
@ -123,8 +123,8 @@ app.use(GridItem);
|
||||
### GridItem Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | --------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| ----- | --------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
|
||||
### GridItem Slots
|
||||
|
||||
|
@ -143,8 +143,8 @@ app.use(GridItem);
|
||||
### GridItem Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | -------------- | -------------- |
|
||||
| click | 点击格子时触发 | _event: Event_ |
|
||||
| ------ | -------------- | ------------------- |
|
||||
| click | 点击格子时触发 | _event: MouseEvent_ |
|
||||
|
||||
### GridItem Slots
|
||||
|
||||
|
@ -98,5 +98,5 @@ import 'vant/lib/icon/local.css';
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ---------------------------- | -------------- |
|
||||
| click | Emitted when icon is clicked | _event: Event_ |
|
||||
| ----- | ---------------------------- | ------------------- |
|
||||
| click | Emitted when icon is clicked | _event: MouseEvent_ |
|
||||
|
@ -104,5 +104,5 @@ import 'vant/lib/icon/local.css';
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | -------------- | -------------- |
|
||||
| click | 点击图标时触发 | _event: Event_ |
|
||||
| ------ | -------------- | ------------------- |
|
||||
| click | 点击图标时触发 | _event: MouseEvent_ |
|
||||
|
@ -98,8 +98,8 @@ app.use(Lazyload);
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ------------------------------ | -------------- |
|
||||
| click | Emitted when image is clicked | _event: Event_ |
|
||||
| ----- | ------------------------------ | ------------------- |
|
||||
| click | Emitted when image is clicked | _event: MouseEvent_ |
|
||||
| load | Emitted when image loaded | - |
|
||||
| error | Emitted when image load failed | - |
|
||||
|
||||
|
@ -130,8 +130,8 @@ app.use(Lazyload);
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ------------------ | -------------- |
|
||||
| click | 点击图片时触发 | _event: Event_ |
|
||||
| ------ | ------------------ | ------------------- |
|
||||
| click | 点击图片时触发 | _event: MouseEvent_ |
|
||||
| load | 图片加载完毕时触发 | - |
|
||||
| error | 图片加载失败时触发 | - |
|
||||
|
||||
|
@ -77,9 +77,9 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----------- | ---------------------------------------- | --------- |
|
||||
| click-left | Emitted when the left button is clicked | - |
|
||||
| click-right | Emitted when the right button is clicked | - |
|
||||
| ----------- | ---------------------------------------- | ------------------- |
|
||||
| click-left | Emitted when the left button is clicked | _event: MouseEvent_ |
|
||||
| click-right | Emitted when the right button is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Less Variables
|
||||
|
||||
|
@ -79,9 +79,9 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ----------- | ------------------ | -------- |
|
||||
| click-left | 点击左侧按钮时触发 | - |
|
||||
| click-right | 点击右侧按钮时触发 | - |
|
||||
| ----------- | ------------------ | ------------------- |
|
||||
| click-left | 点击左侧按钮时触发 | _event: MouseEvent_ |
|
||||
| click-right | 点击右侧按钮时触发 | _event: MouseEvent_ |
|
||||
|
||||
### 样式变量
|
||||
|
||||
|
@ -96,9 +96,9 @@ app.use(NoticeBar);
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ------ | ---------------------------------- | -------------- |
|
||||
| click | Emitted when NoticeBar is clicked | _event: Event_ |
|
||||
| close | Emitted when NoticeBar is closed | _event: Event_ |
|
||||
| ------ | ---------------------------------- | ------------------- |
|
||||
| click | Emitted when NoticeBar is clicked | _event: MouseEvent_ |
|
||||
| close | Emitted when NoticeBar is closed | _event: MouseEvent_ |
|
||||
| replay | Emitted when NoticeBar is replayed | - |
|
||||
|
||||
### Slots
|
||||
|
@ -121,9 +121,9 @@ app.use(NoticeBar);
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------------------------- | -------------- |
|
||||
| click | 点击通知栏时触发 | _event: Event_ |
|
||||
| close | 关闭通知栏时触发 | _event: Event_ |
|
||||
| ------ | ---------------------------- | ------------------- |
|
||||
| click | 点击通知栏时触发 | _event: MouseEvent_ |
|
||||
| close | 关闭通知栏时触发 | _event: MouseEvent_ |
|
||||
| replay | 每当滚动栏重新开始滚动时触发 | - |
|
||||
|
||||
### Slots
|
||||
|
@ -71,8 +71,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | --------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| ----- | --------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -77,8 +77,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -138,10 +138,10 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ---------------- | ---------------------------------- | -------------- |
|
||||
| click | Emitted when Popup is clicked | _event: Event_ |
|
||||
| ---------------- | ---------------------------------- | ------------------- |
|
||||
| click | Emitted when Popup is clicked | _event: MouseEvent_ |
|
||||
| click-overlay | Emitted when overlay is clicked | - |
|
||||
| click-close-icon | Emitted when close icon is clicked | _event: Event_ |
|
||||
| click-close-icon | Emitted when close icon is clicked | _event: MouseEvent_ |
|
||||
| open | Emitted when opening Popup | - |
|
||||
| close | Emitted when closing Popup | - |
|
||||
| opened | Emitted when Popup is opened | - |
|
||||
|
@ -148,10 +148,10 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ---------------- | -------------------------- | -------------- |
|
||||
| click | 点击弹出层时触发 | _event: Event_ |
|
||||
| ---------------- | -------------------------- | ------------------- |
|
||||
| click | 点击弹出层时触发 | _event: MouseEvent_ |
|
||||
| click-overlay | 点击遮罩层时触发 | - |
|
||||
| click-close-icon | 点击关闭图标时触发 | _event: Event_ |
|
||||
| click-close-icon | 点击关闭图标时触发 | _event: MouseEvent_ |
|
||||
| open | 打开弹出层时触发 | - |
|
||||
| close | 关闭弹出层时触发 | - |
|
||||
| opened | 打开弹出层且动画结束后触发 | - |
|
||||
|
@ -177,8 +177,8 @@ export default {
|
||||
### Radio Events
|
||||
|
||||
| Event | Description | Parameters |
|
||||
| ----- | ----------------------------- | -------------- |
|
||||
| click | Emitted when radio is clicked | _event: Event_ |
|
||||
| ----- | ----------------------------- | ------------------- |
|
||||
| click | Emitted when radio is clicked | _event: MouseEvent_ |
|
||||
|
||||
### RadioGroup Events
|
||||
|
||||
|
@ -195,8 +195,8 @@ export default {
|
||||
### Radio Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------------- | -------------- |
|
||||
| click | 点击单选框时触发 | _event: Event_ |
|
||||
| ------ | ---------------- | ------------------- |
|
||||
| click | 点击单选框时触发 | _event: MouseEvent_ |
|
||||
|
||||
### RadioGroup Events
|
||||
|
||||
|
@ -176,8 +176,8 @@ export default {
|
||||
### SwipeItem Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | --------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| ----- | --------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Swipe Methods
|
||||
|
||||
|
@ -186,8 +186,8 @@ export default {
|
||||
### SwipeItem Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | ---------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### Swipe 方法
|
||||
|
||||
|
@ -111,9 +111,9 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Parameters |
|
||||
| ------ | --------------------------------- | -------------- |
|
||||
| ------ | --------------------------------- | ------------------- |
|
||||
| change | Emitted when check status changed | _value: any_ |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
|
||||
### Less Variables
|
||||
|
||||
|
@ -127,9 +127,9 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ------------------ | -------------- |
|
||||
| ------ | ------------------ | ------------------- |
|
||||
| change | 开关状态切换时触发 | _value: any_ |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
|
||||
### 样式变量
|
||||
|
||||
|
@ -106,8 +106,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
| ----- | ---------------------------------- | -------------- |
|
||||
| click | Emitted when component is clicked | _event: Event_ |
|
||||
| ----- | ---------------------------------- | ------------------- |
|
||||
| click | Emitted when component is clicked | _event: MouseEvent_ |
|
||||
| close | Emitted when close icon is clicked | - |
|
||||
|
||||
### Less Variables
|
||||
|
@ -120,8 +120,8 @@ export default {
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | -------------- | -------------- |
|
||||
| click | 点击时触发 | _event: Event_ |
|
||||
| ------ | -------------- | ------------------- |
|
||||
| click | 点击时触发 | _event: MouseEvent_ |
|
||||
| close | 关闭标签时触发 | - |
|
||||
|
||||
### 样式变量
|
||||
|
Loading…
x
Reference in New Issue
Block a user