mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-25 19:06:36 +08:00
docs: add props types to document (#9550)
This commit is contained in:
parent
4f64457aa0
commit
03988a0d32
@ -133,6 +133,7 @@ The component exports the following type definitions:
|
|||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
AddressEditInfo,
|
AddressEditInfo,
|
||||||
|
AddressEditProps,
|
||||||
AddressEditInstance,
|
AddressEditInstance,
|
||||||
AddressEditSearchItem,
|
AddressEditSearchItem,
|
||||||
} from 'vant';
|
} from 'vant';
|
||||||
|
@ -133,6 +133,7 @@ export default {
|
|||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
AddressEditInfo,
|
AddressEditInfo,
|
||||||
|
AddressEditProps,
|
||||||
AddressEditInstance,
|
AddressEditInstance,
|
||||||
AddressEditSearchItem,
|
AddressEditSearchItem,
|
||||||
} from 'vant';
|
} from 'vant';
|
||||||
|
@ -169,7 +169,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Area i
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { AreaList, AreaInstance, AreaColumnOption } from 'vant';
|
import type { AreaProps, AreaList, AreaInstance, AreaColumnOption } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`AreaInstance` is the type of component instance:
|
`AreaInstance` is the type of component instance:
|
||||||
|
@ -171,7 +171,7 @@ confirm 事件返回的数据整体为一个数组,数组每一项对应一列
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { AreaList, AreaInstance, AreaColumnOption } from 'vant';
|
import type { AreaProps, AreaList, AreaInstance, AreaColumnOption } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`AreaInstance` 是组件实例的类型,用法如下:
|
`AreaInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -354,6 +354,7 @@ The component exports the following type definitions:
|
|||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
CalendarType,
|
CalendarType,
|
||||||
|
CalendarProps,
|
||||||
CalendarDayItem,
|
CalendarDayItem,
|
||||||
CalendarDayType,
|
CalendarDayType,
|
||||||
CalendarInstance,
|
CalendarInstance,
|
||||||
|
@ -360,6 +360,7 @@ export default {
|
|||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
CalendarType,
|
CalendarType,
|
||||||
|
CalendarProps,
|
||||||
CalendarDayItem,
|
CalendarDayItem,
|
||||||
CalendarDayType,
|
CalendarDayType,
|
||||||
CalendarInstance,
|
CalendarInstance,
|
||||||
|
@ -333,7 +333,9 @@ The component exports the following type definitions:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
CheckboxProps,
|
||||||
CheckboxInstance,
|
CheckboxInstance,
|
||||||
|
CheckboxGroupProps,
|
||||||
CheckboxGroupInstance,
|
CheckboxGroupInstance,
|
||||||
CheckboxGroupToggleAllOptions,
|
CheckboxGroupToggleAllOptions,
|
||||||
} from 'vant';
|
} from 'vant';
|
||||||
|
@ -351,7 +351,9 @@ checkboxGroup.toggleAll({
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
CheckboxProps,
|
||||||
CheckboxInstance,
|
CheckboxInstance,
|
||||||
|
CheckboxGroupProps,
|
||||||
CheckboxGroupInstance,
|
CheckboxGroupInstance,
|
||||||
CheckboxGroupToggleAllOptions,
|
CheckboxGroupToggleAllOptions,
|
||||||
} from 'vant';
|
} from 'vant';
|
||||||
|
@ -155,7 +155,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Collap
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { CollapseItemInstance } from 'vant';
|
import type { CollapseItemProps, CollapseItemInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`CollapseItemInstance` is the type of component instance:
|
`CollapseItemInstance` is the type of component instance:
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { CollapseItemInstance } from 'vant';
|
import type { CollapseItemProps, CollapseItemInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`CollapseItemInstance` 是组件实例的类型,用法如下:
|
`CollapseItemInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -186,7 +186,11 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get CountD
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { CountDownInstance, CountDownCurrentTime } from 'vant';
|
import type {
|
||||||
|
CountDownProps,
|
||||||
|
CountDownInstance,
|
||||||
|
CountDownCurrentTime,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`CountDownInstance` is the type of component instance:
|
`CountDownInstance` is the type of component instance:
|
||||||
|
@ -196,7 +196,11 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { CountDownInstance, CountDownCurrentTime } from 'vant';
|
import type {
|
||||||
|
CountDownProps,
|
||||||
|
CountDownInstance,
|
||||||
|
CountDownCurrentTime,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`CountDownInstance` 是组件实例的类型,用法如下:
|
`CountDownInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -348,7 +348,11 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Dateti
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { DatetimePickerType, DatetimePickerInstance } from 'vant';
|
import type {
|
||||||
|
DatetimePickerType,
|
||||||
|
DatetimePickerProps,
|
||||||
|
DatetimePickerInstance,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`DatetimePickerInstance` is the type of component instance:
|
`DatetimePickerInstance` is the type of component instance:
|
||||||
|
@ -357,7 +357,11 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { DatetimePickerType, DatetimePickerInstance } from 'vant';
|
import type {
|
||||||
|
DatetimePickerType,
|
||||||
|
DatetimePickerProps,
|
||||||
|
DatetimePickerInstance,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`DatetimePickerInstance` 是组件实例的类型,用法如下:
|
`DatetimePickerInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -197,6 +197,8 @@ The component exports the following type definitions:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
DropdownMenuProps,
|
||||||
|
DropdownItemProps,
|
||||||
DropdownItemOption,
|
DropdownItemOption,
|
||||||
DropdownItemInstance,
|
DropdownItemInstance,
|
||||||
DropdownMenuDirection,
|
DropdownMenuDirection,
|
||||||
|
@ -201,6 +201,8 @@ export default {
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
DropdownMenuProps,
|
||||||
|
DropdownItemProps,
|
||||||
DropdownItemOption,
|
DropdownItemOption,
|
||||||
DropdownItemInstance,
|
DropdownItemInstance,
|
||||||
DropdownMenuDirection,
|
DropdownMenuDirection,
|
||||||
|
@ -315,6 +315,7 @@ The component exports the following type definitions:
|
|||||||
import type {
|
import type {
|
||||||
FieldType,
|
FieldType,
|
||||||
FieldRule,
|
FieldRule,
|
||||||
|
FieldProps,
|
||||||
FieldInstance,
|
FieldInstance,
|
||||||
FieldTextAlign,
|
FieldTextAlign,
|
||||||
FieldClearTrigger,
|
FieldClearTrigger,
|
||||||
|
@ -334,6 +334,7 @@ export default {
|
|||||||
import type {
|
import type {
|
||||||
FieldType,
|
FieldType,
|
||||||
FieldRule,
|
FieldRule,
|
||||||
|
FieldProps,
|
||||||
FieldInstance,
|
FieldInstance,
|
||||||
FieldTextAlign,
|
FieldTextAlign,
|
||||||
FieldClearTrigger,
|
FieldClearTrigger,
|
||||||
|
@ -547,7 +547,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Form i
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { FormInstance } from 'vant';
|
import type { FormProps, FormInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`FormInstance` is the type of component instance:
|
`FormInstance` is the type of component instance:
|
||||||
|
@ -585,7 +585,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { FormInstance } from 'vant';
|
import type { FormProps, FormInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`FormInstance` 是组件实例的类型,用法如下:
|
`FormInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -191,6 +191,7 @@ The component exports the following type definitions:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
ImagePreviewProps,
|
||||||
ImagePreviewOptions,
|
ImagePreviewOptions,
|
||||||
ImagePreviewInstance,
|
ImagePreviewInstance,
|
||||||
ImagePreviewScaleEventParams,
|
ImagePreviewScaleEventParams,
|
||||||
|
@ -241,6 +241,7 @@ export default {
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
ImagePreviewProps,
|
||||||
ImagePreviewOptions,
|
ImagePreviewOptions,
|
||||||
ImagePreviewInstance,
|
ImagePreviewInstance,
|
||||||
ImagePreviewScaleEventParams,
|
ImagePreviewScaleEventParams,
|
||||||
|
@ -104,7 +104,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get IndexB
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { IndexBarInstance } from 'vant';
|
import type { IndexBarProps, IndexBarInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`IndexBarInstance` is the type of component instance:
|
`IndexBarInstance` is the type of component instance:
|
||||||
|
@ -108,7 +108,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { IndexBarInstance } from 'vant';
|
import type { IndexBarProps, IndexBarInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`IndexBarInstance` 是组件实例的类型,用法如下:
|
`IndexBarInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -196,7 +196,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get List i
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { ListInstance, ListDirection } from 'vant';
|
import type { ListProps, ListInstance, ListDirection } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`ListInstance` is the type of component instance:
|
`ListInstance` is the type of component instance:
|
||||||
|
@ -211,7 +211,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { ListInstance, ListDirection } from 'vant';
|
import type { ListProps, ListInstance, ListDirection } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`ListInstance` 是组件实例的类型,用法如下:
|
`ListInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -120,7 +120,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Notice
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { NoticeBarMode, NoticeBarInstance } from 'vant';
|
import type { NoticeBarMode, NoticeBarProps, NoticeBarInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`NoticeBarInstance` is the type of component instance:
|
`NoticeBarInstance` is the type of component instance:
|
||||||
|
@ -141,7 +141,7 @@ app.use(NoticeBar);
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { NoticeBarMode, NoticeBarInstance } from 'vant';
|
import type { NoticeBarMode, NoticeBarProps, NoticeBarInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`NoticeBarInstance` 是组件实例的类型,用法如下:
|
`NoticeBarInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -385,6 +385,7 @@ The component exports the following type definitions:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
PickerProps,
|
||||||
PickerColumn,
|
PickerColumn,
|
||||||
PickerOption,
|
PickerOption,
|
||||||
PickerInstance,
|
PickerInstance,
|
||||||
|
@ -410,6 +410,7 @@ export default {
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
PickerProps,
|
||||||
PickerColumn,
|
PickerColumn,
|
||||||
PickerOption,
|
PickerOption,
|
||||||
PickerInstance,
|
PickerInstance,
|
||||||
|
@ -74,7 +74,7 @@ Use `pivot-text` to custom text,use `color` to custom bar color.
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { ProgressInstance } from 'vant';
|
import type { ProgressProps, ProgressInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`ProgressInstance` is the type of component instance:
|
`ProgressInstance` is the type of component instance:
|
||||||
|
@ -78,7 +78,7 @@ app.use(Progress);
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { ProgressInstance } from 'vant';
|
import type { ProgressProps, ProgressInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`ProgressInstance` 是组件实例的类型,用法如下:
|
`ProgressInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -166,7 +166,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Search
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SearchShape, SearchInstance } from 'vant';
|
import type { SearchProps, SearchShape, SearchInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SearchInstance` is the type of component instance:
|
`SearchInstance` is the type of component instance:
|
||||||
|
@ -178,7 +178,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SearchShape, SearchInstance } from 'vant';
|
import type { SearchProps, SearchShape, SearchInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SearchInstance` 是组件实例的类型,用法如下:
|
`SearchInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -151,7 +151,12 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get SwipeC
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SwipeCellSide, SwipeCellPosition, SwipeCellInstance } from 'vant';
|
import type {
|
||||||
|
SwipeCellSide,
|
||||||
|
SwipeCellProps,
|
||||||
|
SwipeCellPosition,
|
||||||
|
SwipeCellInstance,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SwipeCellInstance` is the type of component instance:
|
`SwipeCellInstance` is the type of component instance:
|
||||||
|
@ -160,7 +160,12 @@ beforeClose 的第一个参数为对象,对象中包含以下属性:
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SwipeCellSide, SwipeCellPosition, SwipeCellInstance } from 'vant';
|
import type {
|
||||||
|
SwipeCellSide,
|
||||||
|
SwipeCellProps,
|
||||||
|
SwipeCellPosition,
|
||||||
|
SwipeCellInstance,
|
||||||
|
} from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SwipeCellInstance` 是组件实例的类型,用法如下:
|
`SwipeCellInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -184,7 +184,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Swipe
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SwipeInstance, SwipeToOptions } from 'vant';
|
import type { SwipeProps, SwipeInstance, SwipeToOptions } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SwipeInstance` is the type of component instance:
|
`SwipeInstance` is the type of component instance:
|
||||||
|
@ -192,7 +192,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { SwipeInstance, SwipeToOptions } from 'vant';
|
import type { SwipeProps, SwipeInstance, SwipeToOptions } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`SwipeInstance` 是组件实例的类型,用法如下:
|
`SwipeInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -286,7 +286,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Tabs i
|
|||||||
The component exports the following type definitions:
|
The component exports the following type definitions:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { TabsType, TabsInstance } from 'vant';
|
import type { TabsType, TabsProps, TabsInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`TabsInstance` is the type of component instance:
|
`TabsInstance` is the type of component instance:
|
||||||
|
@ -299,7 +299,7 @@ export default {
|
|||||||
组件导出以下类型定义:
|
组件导出以下类型定义:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type { TabsType, TabsInstance } from 'vant';
|
import type { TabsType, TabsProps, TabsInstance } from 'vant';
|
||||||
```
|
```
|
||||||
|
|
||||||
`TabsInstance` 是组件实例的类型,用法如下:
|
`TabsInstance` 是组件实例的类型,用法如下:
|
||||||
|
@ -363,6 +363,7 @@ The component exports the following type definitions:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
UploaderProps,
|
||||||
UploaderInstance,
|
UploaderInstance,
|
||||||
UploaderResultType,
|
UploaderResultType,
|
||||||
UploaderFileListItem,
|
UploaderFileListItem,
|
||||||
|
@ -388,6 +388,7 @@ before-read、after-read、before-delete 执行时会传递以下回调参数:
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import type {
|
import type {
|
||||||
|
UploaderProps,
|
||||||
UploaderInstance,
|
UploaderInstance,
|
||||||
UploaderResultType,
|
UploaderResultType,
|
||||||
UploaderFileListItem,
|
UploaderFileListItem,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user