当前位置:网站首页>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]);}};边栏推荐
猜你喜欢
随机推荐
uniapp父组件使用prop将异步的数据传给子组件
性能问题从发现到优化一般思路
Smobiler的复杂控件的由来与创造
Why do you need to cross compiler
【LeetCode】40、组合总和II
Numpy函数、模块、类列表
同花顺可以买股票吗?买股票安全吗?
Nioke 2022 Summer Multi-School 6 B Eezie and Pie (Difference on the tree + multiplication to find the kth ancestor board)
轻量全景查看器 pannellum初探
面了个腾讯30k+出来的,他让我见识到什么叫精通MySQL调优
倒置字符串
传音控股:目前公司手机产品暂无明确计划进入中国市场
牛客多校第6场M(dp或者递推)
Architecture Design Fundamentals
微信小程序云开发 | 插件的微信小程序云开发
Shell正则表达式
2022年美术生就业前景解析
常用字符的编码
CF1165F2(二分答案)
视图,索引









