Skip to content

Commit

Permalink
fix(tag-input): 修复方法传参 (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
skytt committed Jun 16, 2022
1 parent 590d576 commit 45d9e30
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions src/tag-input/tag-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,27 +148,31 @@ export default defineComponent({
placeholder={this.tagInputPlaceholder}
suffix={this.suffix}
suffixIcon={() => suffixIconNode}
onEnter={this.onInputEnter}
onKeyup={this.onInputBackspaceKeyUp}
onMouseenter={(context: { e: MouseEvent }) => {
this.addHover(context);
this.scrollToRightOnEnter();
}}
onMouseleave={(context: { e: MouseEvent }) => {
this.cancelHover(context);
this.scrollToLeftOnLeave();
}}
onFocus={(inputValue: InputValue, context: { e: MouseEvent }) => {
this.onFocus?.(this.tagValue, { e: context.e, inputValue });
this.$emit('focus', this.tagValue, { e: context.e, inputValue });
}}
onBlur={(inputValue: InputValue, context: { e: MouseEvent }) => {
this.onBlur?.(this.tagValue, { e: context.e, inputValue });
this.$emit('blur', this.tagValue, { e: context.e, inputValue });
}}
onPaste={(context: { e: ClipboardEvent; pasteValue: string }) => {
this.onPaste?.(context);
this.$emit('paste', context);
{...{
props: {
onEnter: this.onInputEnter,
onKeyup: this.onInputBackspaceKeyUp,
onMouseenter: (context: { e: MouseEvent }) => {
this.addHover(context);
this.scrollToRightOnEnter();
},
onMouseleave: (context: { e: MouseEvent }) => {
this.cancelHover(context);
this.scrollToLeftOnLeave();
},
onFocus: (inputValue: InputValue, context: { e: MouseEvent }) => {
this.onFocus?.(this.tagValue, { e: context.e, inputValue });
this.$emit('focus', this.tagValue, { e: context.e, inputValue });
},
onBlur: (inputValue: InputValue, context: { e: MouseEvent }) => {
this.onBlur?.(this.tagValue, { e: context.e, inputValue });
this.$emit('blur', this.tagValue, { e: context.e, inputValue });
},
onPaste: (context: { e: ClipboardEvent; pasteValue: string }) => {
this.onPaste?.(context);
this.$emit('paste', context);
},
},
}}
/>
);
Expand Down

0 comments on commit 45d9e30

Please sign in to comment.