checkbox label click event

This commit is contained in:
cookfront 2017-03-08 17:30:55 +08:00
parent 99bf210b62
commit 7278df2f00

View File

@ -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>