TypeError: this.$refs.tree.getCheckedNodes is not a function
tree组件在for循环中无法使用getCheckedNodes这个方法
<li v-for="item in 3">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" @input="textCheckNode(filterText)"></el-input>
<el-tree
ref="tree"
class="filter-tree"
:props="defaultProps"
:data="data2"
default-expand-all
show-checkbox
:filter-node-method="filterNode">
</el-tree>
</li>
因为生成了三个tree
解决方法:
image.png
网友评论