## Field ### Install ``` javascript import { Field } from 'vant'; Vue.use(Field); ``` ### Usage #### Basic Usage The value of filed is bound with v-model. ```html ``` #### Custom type Use `type` prop to custom diffrent type fileds. ```html ``` #### Disabled ```html ``` #### Error info Use `error` or `error-message` to show error info ```html ``` #### Auto resize Textarea Filed can be auto resize when has `autosize` prop ```html ``` #### Insert button Use button slot to insert button ```html Send SMS ``` ### API Filed support all native properties of input tag,such as `maxlength`、`placeholder`、`readonly`、`autofocus` | Attribute | Description | Type | Default | |-----------|-----------|-----------|-------------| | value | Filed value | `String` | - | | label | Filed label | `String` | - | | type | Input type | `String` | `text` | | disabled | Disable field | `Boolean` | `false` | | error | Whether to show error info | `Boolean` | `false` | | error-message | Error message | `String` | `''` | | autosize | Textarea auto resize,can accpet an object, e.g. { maxHeight: 100, minHeight: 50 } | `Boolean | Object` | `false` | | icon | Right side icon name | `String` | - | | left-icon | Left side icon name | `String` | - | ### Event Filed support all native events of input tag,such as `focus`、`blur`、`keypress` | Event | Description | Parameters | |-----------|-----------|-----------| | click-icon | Triggered when click the icon of filed | - | ### Slot | name | Description | |-----------|-----------| | label | Custom label | | icon | Custom icon | | button | Insert button |