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">
|
<span class="zan-checkbox__input">
|
||||||
<input
|
<input
|
||||||
|
ref="input"
|
||||||
v-model="currentValue"
|
v-model="currentValue"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="zan-checkbox__control"
|
class="zan-checkbox__control"
|
||||||
@ -16,7 +17,7 @@
|
|||||||
}">
|
}">
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="zan-checkbox__label">
|
<span class="zan-checkbox__label" @click="handleLabelClick">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -92,6 +93,15 @@ export default {
|
|||||||
? this.parentGroup.disabled || this.disabled
|
? this.parentGroup.disabled || this.disabled
|
||||||
: this.disabled;
|
: this.disabled;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handleLabelClick() {
|
||||||
|
if (this.isDisabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.input.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user