当前位置:网站首页>El - tree set radio, click finish after assemble
El - tree set radio, click finish after assemble
2022-08-08 18:44:00 【Tsing Yi Liuyang】
It can be used when the page layout space is insufficient. Click to display the tree drop-down. After the selection is completed, take it back. Here, the tree component can only be selected.You can configure it at will.
node-key must be added, marking each node,
expanded property is to set the expansion and collapse of each node, traverse each node and set expanded to false to collapse the node of the tree.
setCheckedNodes Set the currently checked nodes. To use this method, you must set the node-key property in advance.
@check event is triggered after clicking the node checkbox
The two parameters are: the object corresponding to the node in the array passed to the data attribute, the current selected state object of the tree, and use currObj to save the current selectionnode data.Use setCheckedNodes to set the selected node to currObj.
html code
<el-tree :data=" treeData" :props="defaultProps" node-key="id" ref="tree" show-checkbox @check="handleNodeChecked" >el-tree>
js part of the code
const handleNodeChecked = (currObj, isCheckedspan>) => {const nodeDatas = proxy.$refs.tree.store.nodesMap;for (let key in nodeDatas) {nodeDatas[key].expanded = false;}if (isChecked) {proxy.$refs.tree.setCheckedNodes([currObj]);}};
边栏推荐
猜你喜欢
随机推荐
请问在MAXCOMPUTE SQL 里有没有函数判断string 是否为数字?
OpenSSH生成的私钥如何在putty中使用?
Edu Codeforces 103 (div2)
面试突击:输入URL之后会执行什么流程?
el-tree设置单选,点击完成后收起
echart 股票数据分析 开发备忘录
Go-Excelize API源码阅读(四)——Save()
蒲公英R300A 4G路由器,远程监控PLC教程
数据压缩和归档(三)、tarfile
codeforces 231A.Team
This error is reported when the shake database is started. Is there a problem with the configuration?
黑磷量子点/无机荧光量子点/石墨烯量子点水凝胶/量子点/纳米水凝胶荧光探针的研究制备
Rethinking HTAP database caused by rereading GPDB and TiDB papers
APICloud AVM 封装日期和时间选择组件
搭建DG导致归档日志量变多问题排查
倒置字符串
SUSECON 北京议程上新丨8月16日相聚望京凯悦
Is there any function in MAXCOMPUTE SQL to judge whether the string is a number?
ABAP 报表中如何给报表的输入参数增添 F4 Value Help 试读版
/目录 、/home目录 、~目录的区别