提交 8605e3d2 编写于 作者: H hu0950 提交者: doly mood

docs(form fields): add input events (#468)

* docs(checkbox and checkbox-group): add events

* docs(components of form type): add input event documentation

* docs(rate component): modify documents

* docs(components of form type): modify events description

* docs(input): modify events description
上级 6f63cd14
......@@ -78,3 +78,11 @@
| disabled | whether disabled | Boolean |
Note: each `options` item can be an string value, now both the`label` and `value` values are the string value.
### Events
| Event Name | Description | Parameter |
| - | - | - |
| checked | triggers when an checkbox in the checkboxGroup is checked | the currently checked checkbox value |
| cancel-checked | triggers when an checkbox in the checkboxGroup is unchecked | the currently unchecked checkbox value |
| input | triggers when the binding value changes | a set of the values of selected checkboxs |
......@@ -75,7 +75,7 @@
| Attribute | Description | Type | Accepted Values | Default |
| - | - | - | - | - |
| option | option value | Boolean/String/Object | - | - |
| option | option value(if the value of option is a string type, the label and value will be this string you just set for option.) | Boolean/String/Object | - | - |
| position | icon position | String | left/right | left |
| shape | icon shape | String | circle/square | circle |
| hollowStyle | whether is hollow-out style | Boolean | true/false | false |
......@@ -87,3 +87,9 @@
| label | the text of label | String |
| value | the value of checkbox item | String/Number |
| disabled | whether the checkbox item is disabled | Boolean |
### Events
| Event Name | Description | Parameter |
| - | - | - |
| input | triggers when the binding value changes | the updated value( if you set value in the option and the checkbox is checked, the value is option.value; otherwise, the value is the v-model value of checkbox )|
......@@ -115,12 +115,14 @@ Input component. You can use the `v-model` directive to create two-way data bind
| prepend | prepend content |
| append | append content |
### Event
### Events
| Event Name | Description | Parameters |
| - | - | - |
| focus | This event is triggered after the input box is focused. If input is disabled, it will not be triggered | e - event |
| blur | This event is triggered after the input box blur | e - event |
| change | The event is triggered after the binding value is changed and the input box is blur | e - event |
| input | The event is triggered when the binding value is changed | The updated value |
### Instance methods
......
......@@ -166,3 +166,9 @@ Note: Each item of `options` can be an string, Which means both the `label` and
| label | the text of label | String |
| value | the value of radio item | String/Number |
| disabled | whether the radio item is disabled | Boolean |
### Events
| Event Name | Description | Parameters |
| - | - | - |
| input | triggers when the binding value changes | the value of the chosen radio |
......@@ -99,3 +99,9 @@ Rate component. You can customize the rating star numbers, and disable the inter
| Name | Description | Scope parameters |
| - | - | - |
| default | custom star element | - |
### Events
| Event Name | Description | Parameters |
| - | - | - |
| input | The event triggers when the finger is removed from the rate item (this event will be not triggered when the disabled attribute is set) | The value of the rate item that is currently removed from |
......@@ -94,6 +94,7 @@ If an option is not an object, such as 2014,we will transform it to { value: 2
| Event Name | Description | Parameters 1 | Parameters 2 | Parameters 3 |
| - | - | - | - | - |
| input | when the selected value changed by select | the selected value | - | - |
| change | when the selected value changed by select | the selected value | the selected index | the selected text |
| picker-show | when Picker show | - | - | - |
| picker-hide | when Picker hide | - | - | - |
| picker-hide | when Picker hide | - | - | - |
\ No newline at end of file
......@@ -39,3 +39,9 @@ Switch usually used to switch the state of on/off.
| - | - | - | - | - |
| v-model | the state of on/off, two-way data binding | Boolean | true/false | false |
| disabled | whether disabled | Boolean | true/false | false |
### Events
| Event Name | Description | Parameters |
| - | - | - |
| input | triggers when the binding value changes | the updated value |
......@@ -104,12 +104,13 @@ Multi-line input box components. You can use the `v-model` directive to create t
| remain | whether show the remaining count, if this value is `false` means show the textarea value length | Boolean | true/false | true |
| negative | avaliable when `remain` is true, this value control whether allow remaining number is negative | Boolean | true/false | true |
### Event
### Events
| Event Name | Description | Parameters |
| - | - | - |
| focus | This event is triggered after the textarea box is focused. If Textarea is disabled, it will not be triggered | e - event |
| blur | This event is triggered after the textarea box blur | e - event |
| input | The event is triggered when the binding value changes | The updated value |
### Instance methods
......
......@@ -221,6 +221,7 @@ A function with two parameters: `(file, next)`, the `file` is the original file
| file-success | triggers when a file is uploaded successfully | the file object |
| file-error | triggers when a file is failed to upload | the file object |
| file-click | triggers when a file is clicked | the file object |
| input | triggers when the binding value(file list) changes | the updated value(file list) |
### Instance methods
......
......@@ -249,6 +249,7 @@ Validator is used to validate form data and corresponding warning message.
| validating | validating (only triggered when async validateing) | - |
| validated | validated (only triggered when async validateing) | valid: 校验是否成功 |
| msg-click | click error message ele | - |
| input | triggers when the binding value changes | the updated value |
### Instance methods
......
......@@ -76,3 +76,11 @@
| disabled | 复选框是否被禁用 | Boolean |
注:如果 `options` 中的项为字符串也是可以的,此时默认 `label``value` 的值都为该字符串的值。
### 事件
| 事件名 | 说明 | 参数 |
| - | - | - |
| checked | 勾选复选框组中的某一项时触发 | 当前勾选的复选框值 |
| cancel-checked | 取消勾选复选框组中的某一项时触发 | 当前取消勾选的复选框值 |
| input | 当绑定值变化时触发 | 当前选中的复选框值的集合 |
......@@ -73,7 +73,7 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| - | - | - | - | - |
| option | 配置项 | Boolean/String/Object | - | - |
| option | 配置项(如果 options 中的项为字符串,此时默认 label 和 value 的值都为该字符串的值) | Boolean/String/Object | - | - |
| position | 位置 | String | left/right | left |
| shape | 图标形状 | String | circle/square | circle |
| hollowStyle | 是否是镂空样式的 | Boolean | true/false | false |
......@@ -85,3 +85,9 @@
| label | 复选框显示文字 | String |
| value | 复选框的值 | String/Number |
| disabled | 复选框是否被禁用 | Boolean |
### 事件
| 事件名 | 说明 | 参数 |
| - | - | - |
| input | 当绑定值变化时触发 | 更新后的复选框的值(若option中设置了value,且勾选复选框时,该值为option.value;否则,该值为复选框的v-model值)|
......@@ -122,6 +122,8 @@
| - | - | - |
| focus | 输入框聚焦后触发此事件,如果禁用状态,则不触发 | e - 事件对象 |
| blur | 输入框失焦后触发此事件 | e - 事件对象 |
| change | 绑定值改变且输入框失去焦点后触发 | e - 事件对象 |
| input | 绑定值变化时触发 | 更新后的绑定值 |
### 实例方法
......
......@@ -166,3 +166,9 @@
| label | 单选框显示文字 | String |
| value | 单选框的值 | String/Number |
| disabled | 单选框是否被禁用 | Boolean |
### 事件
| 事件名 | 说明 | 参数 |
| - | - | - |
| input | 绑定值变化时触发 | 选中的单选框value值 |
......@@ -99,3 +99,9 @@
| 名字 | 说明 | 作用域参数 |
| - | - | - |
| default | 自定义星星元素 | - |
### 事件
| 事件名 | 说明 | 参数 |
| - | - | - |
| input | 手指从 rate item 移开时触发(当设置了 disabled 属性时,该事件不触发) | 当前移开的 rate item 的值 |
......@@ -92,6 +92,7 @@ __注:__ 由于此组件依赖 [Picker](#/zh-CN/docs/picker) 组件,而 Pick
| 事件名 | 说明 | 参数1 | 参数2 | 参数3 |
| - | - | - | - | - |
| input | 在选择时,如果选择的值改变了派发 | 选中项的值 | - | - |
| change | 在选择时,如果选择的值改变了派发 | 选中项的值 | 选中项的索引 | 选中项的文案 |
| picker-show | 使用的 Picker 显示的时候派发 | - | - | - |
| picker-hide | 使用的 Picker 隐藏的时候派发(确定或取消都会派发) | - | - | - |
......@@ -39,3 +39,9 @@
| - | - | - | - | - |
| v-model | 开关状态,双向数据绑定 | Boolean | true/false | false |
| disabled | 是否禁用 | Boolean | true/false | false |
### 事件
| 事件名 | 说明 | 参数 |
| - | - | - |
| input | 绑定值变化时触发 | 更新后的绑定值 |
......@@ -101,6 +101,7 @@
| - | - | - |
| focus | 输入框聚焦后触发此事件,如果禁用状态,则不触发 | e - 事件对象 |
| blur | 输入框失焦后触发此事件 | e - 事件对象 |
| input | 绑定值变化时触发 | 更新后的绑定值 |
### 实例方法
......
......@@ -227,6 +227,7 @@
| file-success | 文件上传成功后触发 | 文件对象 |
| file-error | 文件上传失败后触发 | 文件对象 |
| file-click | 文件点击后触发 | 文件对象 |
| input | 绑定值(文件列表)改变后触发 | 更新后的绑定值(文件列表) |
### 实例方法
......
......@@ -255,6 +255,7 @@
| validating | 正在校验(只在异步场景下触发) | - |
| validated | 校验完成(只在异步场景下触发) | valid: 校验是否成功 |
| msg-click | 错误消息点击 | - |
| input | 绑定值变化时触发 | 更新后的绑定值 |
### 实例方法
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册