el-autocomplete 聚焦
时间: 2023-08-27 07:09:30 浏览: 129
el-autocomplete 聚焦的问题可能是由于使用了 clearable 属性导致的。根据引用\[3\]的描述,当点击清除图标后,如果已经是聚焦状态,再次点击输入框时下拉框不会再显示。这可能是因为清除图标的点击事件会导致输入框失去焦点,从而不再显示下拉框。解决这个问题的方法是在清除图标的点击事件中手动将输入框聚焦,可以使用 ref 属性来获取 el-autocomplete 组件的实例,然后调用其 focus 方法来实现聚焦。
#### 引用[.reference_title]
- *1* [【ElementUI】el-autocomplete 远程搜索自动填充](https://blog.csdn.net/wuli_youhouli/article/details/124673271)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [vue点击input框弹出autocomplete框自动获取焦点](https://blog.csdn.net/lovezhuer1/article/details/104498347)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [ElementUi el-autocomplete 踩坑 (使用clearable清除,点击输入框下拉条件不再显示)](https://blog.csdn.net/weixin_42190844/article/details/120768467)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文