[new feature] : 单选框、复选框支持form-field (#694)

This commit is contained in:
rex 2018-10-08 15:05:45 +08:00 committed by neverland
parent 038f835fa6
commit 6be79ed222
6 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,8 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true,
relation: { relation: {
name: 'checkbox', name: 'checkbox',
type: 'descendant', type: 'descendant',

View File

@ -158,6 +158,7 @@ Page({
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| name | 在表单内提交时的标识符 | `String` | - |
| value | 所有选中项的 name | `Array` | - | | value | 所有选中项的 name | `Array` | - |
| disabled | 是否禁用所有单选框 | `Boolean` | `false` | | disabled | 是否禁用所有单选框 | `Boolean` | `false` |
| max | 设置最大可选数 | `Number` | `0`(无限制) | | max | 设置最大可选数 | `Number` | `0`(无限制) |

View File

@ -1,6 +1,8 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true,
relation: { relation: {
name: 'checkbox-group', name: 'checkbox-group',
type: 'ancestor' type: 'ancestor'
@ -9,7 +11,6 @@ VantComponent({
classes: ['icon-class', 'label-class'], classes: ['icon-class', 'label-class'],
props: { props: {
name: null,
value: null, value: null,
disabled: Boolean, disabled: Boolean,
labelDisabled: Boolean, labelDisabled: Boolean,

View File

@ -1,6 +1,8 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true,
relation: { relation: {
name: 'radio', name: 'radio',
type: 'descendant', type: 'descendant',

View File

@ -51,8 +51,8 @@
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| name | 标识 Radio 名称 | 任意类型 | - | | name | 标识 Radio 名称 | `any` | - |
| value | 当前选中项的 name | 任意类型 | - | | value | 当前选中项的 name | `any` | - |
| disabled | 是否为禁用状态 | `Boolean` | `false` | | disabled | 是否为禁用状态 | `Boolean` | `false` |
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` | | label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` |
| label-position | 文本位置,可选值为 `left` | `String` | `right` | | label-position | 文本位置,可选值为 `left` | `String` | `right` |
@ -75,7 +75,8 @@
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| value | 当前选中项的 name | 任意类型 | - | | name | 在表单内提交时的标识符 | `String` | - |
| value | 当前选中项的 name | `any` | - |
| disabled | 是否禁用所有单选框 | `Boolean` | `false` | | disabled | 是否禁用所有单选框 | `Boolean` | `false` |
### RadioGroup Event ### RadioGroup Event

View File

@ -1,6 +1,8 @@
import { VantComponent } from '../common/component'; import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true,
relation: { relation: {
name: 'radio-group', name: 'radio-group',
type: 'ancestor' type: 'ancestor'