docs(Form): add with field tip (#8750)

This commit is contained in:
neverland 2021-05-23 08:57:29 +08:00 committed by GitHub
parent e5a326ee5a
commit 642d9cca30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -1,12 +1,18 @@
# Form
### Intro
Used for data entry and verification, and supports input boxes, radio buttons, check boxes, file uploads and other types. Should be used with [Field](#/en-US/field) component.
### Install
```js
import Vue from 'vue';
import { Form } from 'vant';
import { Field } from 'vant';
Vue.use(Form);
Vue.use(Field);
```
## Usage
@ -454,11 +460,11 @@ export default {
### validate-trigger
| Value | Description |
| -------- | --------------------------------------------------------------- |
| onSubmit | Trigger validation after submiting form |
| onBlur | Trigger validation after submiting form or bluring input |
| onChange | Trigger validation after submiting form or changing input value |
| Value | Description |
| -------- | ---------------------------------------------------------------- |
| onSubmit | Trigger validation after submitting form |
| onBlur | Trigger validation after submitting form or bluring input |
| onChange | Trigger validation after submitting form or changing input value |
### Events

View File

@ -2,15 +2,17 @@
### 介绍
用于数据录入、校验支持输入框、单选框、复选框、文件上传等类型2.5 版本开始支持此组件。
用于数据录入、校验,支持输入框、单选框、复选框、文件上传等类型,需要与 [Field 输入框](#/zh-CN/field) 组件搭配使用。2.5 版本开始支持此组件。
### 引入
```js
import Vue from 'vue';
import { Form } from 'vant';
import { Field } from 'vant';
Vue.use(Form);
Vue.use(Field);
```
## 代码演示