mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 10:20:19 +08:00
[bugfix] Radio: icon not clickable (#505)
This commit is contained in:
parent
69faabb539
commit
0ab473a273
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
@click="handleRadioClick"
|
|
||||||
class="van-radio"
|
class="van-radio"
|
||||||
:class="{ 'van-radio--disabled': isDisabled }">
|
:class="{ 'van-radio--disabled': isDisabled }"
|
||||||
|
@click="$emit('click')"
|
||||||
|
>
|
||||||
<span class="van-radio__input">
|
<span class="van-radio__input">
|
||||||
<input
|
<input
|
||||||
:value="name"
|
:value="name"
|
||||||
@ -13,7 +14,7 @@
|
|||||||
>
|
>
|
||||||
<icon :name="currentValue === name ? 'checked' : 'check'" />
|
<icon :name="currentValue === name ? 'checked' : 'check'" />
|
||||||
</span>
|
</span>
|
||||||
<span class="van-radio__label" @click="handleLabelClick">
|
<span class="van-radio__label" @click="onClickLabel">
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -63,15 +64,11 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handleLabelClick() {
|
onClickLabel() {
|
||||||
if (this.isDisabled) {
|
if (this.isDisabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentValue = this.name;
|
this.currentValue = this.name;
|
||||||
},
|
|
||||||
|
|
||||||
handleRadioClick() {
|
|
||||||
this.$emit('click');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -33,6 +33,7 @@ $van-radio-size: 20px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-icon {
|
.van-icon {
|
||||||
|
pointer-events: none;
|
||||||
font-size: $van-radio-size;
|
font-size: $van-radio-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user