diff --git a/docs/demos/views/checkbox.vue b/docs/demos/views/checkbox.vue
index e3962cf1b..b7555f1e4 100644
--- a/docs/demos/views/checkbox.vue
+++ b/docs/demos/views/checkbox.vue
@@ -9,6 +9,11 @@
{{ $t('checkbox') }} 2
+
+ {{ $t('checkbox') }} 2
+ {{ $t('checkbox') }} 2
+
+
复选框 2
```
+#### 禁用内容部分点击事件
+```html
+复选框 3
+```
#### Checkbox 组
需要与`van-checkbox-group`一起使用,选中值是一个数组,通过`v-model`绑定在`van-checkbox-group`上,数组中的项即为选中的`Checkbox`的`name`属性设置的值
@@ -93,6 +97,7 @@ export default {
|-----------|-----------|-----------|-------------|-------------|
| name | 标识 Checkbox 名称 | `Boolean` | `false` | - |
| disabled | 是否禁用单选框 | `Boolean` | `false` | - |
+| label-disabled | 是否禁用单选框内容点击 | `Boolean` | `false` | - |
| shape | 形状 | `String` | `round` | `square` |
### CheckboxGroup API
diff --git a/packages/checkbox/index.vue b/packages/checkbox/index.vue
index ba92c4cc0..54cebf158 100644
--- a/packages/checkbox/index.vue
+++ b/packages/checkbox/index.vue
@@ -10,7 +10,7 @@
]"
@click="onClick"
/>
-
+
@@ -28,6 +28,10 @@ export default create({
props: {
value: {},
disabled: Boolean,
+ labelDisabled: {
+ type: Boolean,
+ default: false
+ },
name: [String, Number],
shape: {
type: String,
@@ -96,8 +100,8 @@ export default create({
},
methods: {
- onClick() {
- if (!this.isDisabled) {
+ onClick(flag) {
+ if (!this.isDisabled && (flag !== 'label' || (flag === 'label' && !this.labelDisabled))) {
this.currentValue = !this.currentValue;
}
}