下拉框如何实现鼠标收起
时间: 2024-04-24 09:24:41 浏览: 66
下拉框的实现
要实现下拉框鼠标收起的功能,可以通过设置下拉框的dropDownVisible属性为false来实现。根据提供的代码,可以在watch中监听menuIDList的变化,然后通过this.$refs.cascader.dropDownVisible = false来将下拉框收起。具体代码如下:
```javascript
watch: {
menuIDList() {
if (this.$refs.cascader) {
this.$refs.cascader.dropDownVisible = false;
}
}
}
```
这样,当menuIDList的值发生变化时,下拉框就会自动收起。
#### 引用[.reference_title]
- *1* [vue element-ui级联选择器选中后下拉框自动收起](https://blog.csdn.net/weixin_43162418/article/details/121648775)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [记录:vue element-ui级联选择器选中后下拉框自动收起](https://blog.csdn.net/iseyre/article/details/129036757)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [关于elementUI的select-tree组合下拉框,选择后下拉框不收起](https://blog.csdn.net/weixin_44847425/article/details/121909590)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文