[new feature] Field: add click event

This commit is contained in:
陈嘉涵
2019-05-31 21:16:38 +08:00
parent a8a18505a6
commit 9a32a4a35d
6 changed files with 21 additions and 2 deletions
+10 -1
View File
@@ -59,13 +59,17 @@ export default sfc({
},
listeners() {
return {
const listeners = {
...this.$listeners,
input: this.onInput,
keypress: this.onKeypress,
focus: this.onFocus,
blur: this.onBlur
};
delete listeners.click;
return listeners;
},
labelStyle() {
@@ -130,6 +134,10 @@ export default sfc({
}
},
onClick(event) {
this.$emit('click', event);
},
onClickLeftIcon() {
this.$emit('click-left-icon');
},
@@ -272,6 +280,7 @@ export default sfc({
'min-height': this.type === 'textarea' && !this.autosize
})}
scopedSlots={scopedSlots}
onClick={this.onClick}
>
<div class={bem('body')}>
{this.renderInput()}