
-
<el-input placeholder="输入关键字进行过滤"
v-model="filterText"
@input='filterTextchange'
style='margin-bottom: 20px;'>
</el-input>
<el-tree class="filter-tree"
:data="ruleForm.rangeType==10?unionList:industryCategory"
accordion
node-key="id"
show-checkbox
default-expand-all
:default-checked-keys="treekeydata"
:props="defaultProps"
@check="handleCheckChange"
:filter-node-method="filterNode"
ref="tree">
</el-tree>
2 . treekeydata Array tree选中的key
treedata1 Array 右边tree的数据 -
选中节点事件
handleCheckChange (data, checked) {
let keyFalg = this.treedata1.findIndex(item => item.code == data.code)
if (keyFalg == -1) {
this.refs.tree.getCheckedKeys(true)
this.treekeydata = this.treedata1.map(item => item.id)},
//右边删除事件
handleClose (data) {
this.treedata1.splice(this.treekeydata.indexOf(data.id), 1)
this.treekeydata.splice(this.treekeydata.indexOf(data.id), 1)this.$refs.tree.setCheckedKeys(this.treekeydata)
},
网友评论