mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(Form): add type definition
This commit is contained in:
parent
27187a2fc4
commit
d80bbf64dd
@ -443,6 +443,8 @@ export default {
|
|||||||
| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | *string* | `left` |
|
| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | *string* | `left` |
|
||||||
| validate-first | 是否在某一项校验不通过时停止校验 | *boolean* | `false` |
|
| validate-first | 是否在某一项校验不通过时停止校验 | *boolean* | `false` |
|
||||||
|
|
||||||
|
> 表单项的 API 参见:[Field 组件](#/zh-CN/field#api)
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| 事件名 | 说明 | 回调参数 |
|
| 事件名 | 说明 | 回调参数 |
|
||||||
|
9
types/form.d.ts
vendored
Normal file
9
types/form.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { VanComponent } from './component';
|
||||||
|
|
||||||
|
export class Form extends VanComponent {
|
||||||
|
submit(): void;
|
||||||
|
|
||||||
|
validate(name?: string): Promise<void>;
|
||||||
|
|
||||||
|
resetValidation(name?: string): void;
|
||||||
|
}
|
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -11,6 +11,7 @@ import { DatetimePicker } from './datetime-picker';
|
|||||||
import { Dialog } from './dialog';
|
import { Dialog } from './dialog';
|
||||||
import { DropdownItem } from './dropdown-item';
|
import { DropdownItem } from './dropdown-item';
|
||||||
import { Field } from './field';
|
import { Field } from './field';
|
||||||
|
import { Form } from './form';
|
||||||
import { ImagePreview } from './image-preview';
|
import { ImagePreview } from './image-preview';
|
||||||
import { Lazyload } from './lazyload';
|
import { Lazyload } from './lazyload';
|
||||||
import { List } from './list';
|
import { List } from './list';
|
||||||
@ -98,6 +99,7 @@ export {
|
|||||||
DatetimePicker,
|
DatetimePicker,
|
||||||
Dialog,
|
Dialog,
|
||||||
DropdownItem,
|
DropdownItem,
|
||||||
|
Form,
|
||||||
Field,
|
Field,
|
||||||
ImagePreview,
|
ImagePreview,
|
||||||
Lazyload,
|
Lazyload,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user