2021-07-29 TypeError: this.$refs

2021-07-29  本文已影响0人  半眼鱼

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
上一篇 下一篇

猜你喜欢

热点阅读