实现之后的单选效果图:
下面贴代码:
结构:
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText">
</el-input>
<el-tree
class="filter-tree"
:data="treeObj.optionList"
:props="defaultProps"
node-key="value"
:check-strictly="true"
default-expand-all
show-checkbox
@check="treeNodeClick"
:filter-node-method="filterNode"
ref="tree">
</el-tree>
数据来源格式:
treeObj = {
optionList: [{
label: '一级 1',
value: '1',
children: [{
label: '二级 1-1',
value: '1-1',
children: [</