Why doesn't it work when I press enter in the input box to lose focus?

problem description

I added an id, to the input input box and then pressed enter to trigger a js event in which the input input box lost focus, but why didn"t it take effect?

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

<form-Item prop="CUSTID" label="" >
     <i-input search type="text" id="customerModal" enter-button="" number @on-search="searchCustInfo("formInline")" v-model="custIdForm.CUSTID" placeholder=""></i-input>
</form-Item>

 searchCustInfo(name){
     $("-sharpcustomerModal").blur();
 }

what result do you expect? What is the error message actually seen?

Dec.03,2021

i-input is a component, what you get by setting id to the component is the outermost dom element of the component, not the input box, so naturally you won't get the effect you want. The input component of
iview does not provide a blur event, but there is an input element inside the component. You can set the ref attribute to i-input, such as ref= "input", and then this.$refs.input.$el.querySelector ('input') can get the internal input element.

Menu