[new feature] Field: add click event
This commit is contained in:
+10
-1
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user