mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
checkbox label click event
This commit is contained in:
parent
99bf210b62
commit
7278df2f00
@ -6,6 +6,7 @@
|
||||
}">
|
||||
<span class="zan-checkbox__input">
|
||||
<input
|
||||
ref="input"
|
||||
v-model="currentValue"
|
||||
type="checkbox"
|
||||
class="zan-checkbox__control"
|
||||
@ -16,7 +17,7 @@
|
||||
}">
|
||||
</span>
|
||||
</span>
|
||||
<span class="zan-checkbox__label">
|
||||
<span class="zan-checkbox__label" @click="handleLabelClick">
|
||||
<slot></slot>
|
||||
</span>
|
||||
</div>
|
||||
@ -92,6 +93,15 @@ export default {
|
||||
? this.parentGroup.disabled || this.disabled
|
||||
: this.disabled;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleLabelClick() {
|
||||
if (this.isDisabled) {
|
||||
return;
|
||||
}
|
||||
this.$refs.input.click();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user