[Improvement] Radio: add label-disabled prop (#1445)

This commit is contained in:
neverland 2018-07-09 21:15:01 +08:00 committed by GitHub
parent 7c3d3db630
commit b5b25ac923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -60,6 +60,7 @@ export default {
|-----------|-----------|-----------|-------------|
| name | Radio name | `any` | - |
| disabled | Whether to disable radio | `Boolean` | `false` |
| label-disabled | Whether to disable label click | `Boolean` | `false` |
### RadioGroup API

View File

@ -28,7 +28,8 @@ export default create({
props: {
name: null,
value: null,
disabled: Boolean
disabled: Boolean,
labelDisabled: Boolean
},
computed: {
@ -55,7 +56,7 @@ export default create({
methods: {
onClickLabel() {
if (!this.isDisabled) {
if (!this.isDisabled && !this.labelDisabled) {
this.currentValue = this.name;
}
}

View File

@ -60,8 +60,9 @@ export default {
| 参数 | 说明 | 类型 | 默认值 |
|-----------|-----------|-----------|-------------|
| name | 唯一标识符 | 任意类型 | - |
| name | 标识 Radio 名称 | 任意类型 | - |
| disabled | 是否为禁用状态 | `Boolean` | `false` |
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` |
### RadioGroup API