el-tree 不可选
时间: 2023-10-08 07:09:08 浏览: 106
el-tree-selected-tree
el-tree中的不可选项可以通过在数据中添加disabled属性来实现。在引用中的代码示例中,可以看到在el-tree的props属性中设置了disabled属性的值。具体地,在defaultProps对象中的disabled属性定义了一个函数来判断是否为不可选的父级。如果一个节点拥有children属性且children的长度大于0,则该节点被视为不可选的父级,从而添加了disabled属性。因此,el-tree中的disabled属性可以根据数据的结构和判断条件来动态设置,实现不可选的效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [vue el-select与el-tree的结合使用 支持可搜索树型](https://blog.csdn.net/qq_36410795/article/details/123407464)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [element tree单选 控制带有子级的父级不可选](https://blog.csdn.net/weixin_44741820/article/details/120518103)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [el-tree实现el-transfer(穿梭框)的效果代码(全)](https://download.csdn.net/download/qq_29124867/85220064)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文