How to hide or lose focus on the drop-down list of el-select through js or vue.js?

upgrading the latest version of elementUI makes it easier to use the blur method

Apr.11,2021

I tested it with JSFiddle .

Click button, and then click to expand the select, for two seconds when the setTimeout is over, the options will indeed be hidden.
still can't determine your problem for the time being.
maybe you can add some related code, or restore a demo with something like JSfiddle to check

.

I wonder if there is a blur event inside this component.? Ask the same question

clipboard.png

there is indeed this method in the source code! I wonder if your ref didn't get this component?


it's amazing that I also use this method. My focus () is invalid and, blur () is valid.

element-ui version 2.4.11

solution : el-select add filterable attribute, first can be output to focus


when you encounter the same problem, leave a solution for the newcomers:

put the final effect first: JSFiddle .

restore scenario:
1 when filterable is added, select will not automatically shrink
2 for multiple select add the same ref then this.$refs.chooseKpi.blur () invalidate / / chooseKpi is the rel name of select

experience:
1 there will be a pop-up window after switching option . Click cancel in the pop-up window or make sure that the shrinking effect of select will have different forms of expression

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eac987-20f0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eac987-20f0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?