mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] Radio: add label-disabled prop (#1445)
This commit is contained in:
parent
7c3d3db630
commit
b5b25ac923
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +60,9 @@ export default {
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------|-----------|-------------|
|
||||
| name | 唯一标识符 | 任意类型 | - |
|
||||
| name | 标识 Radio 名称 | 任意类型 | - |
|
||||
| disabled | 是否为禁用状态 | `Boolean` | `false` |
|
||||
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` |
|
||||
|
||||
### RadioGroup API
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user