filterNode(value, data, node) {
if (!value) return true
let parentNode = node.parent
let labels = [data[this.defaultProps.label || "name"].toLowerCase()]
let level = 1
while (level < node.level) {
labels = [...labels, parentNode.label.toLowerCase()]
parentNode = parentNode.parent
level++
}
return labels.some(label => label.indexOf(value.toLowerCase()) !== -1)
}
toLowerCase()实现中英文过滤
这个方法有三个参数,value:输入的搜索词,data是当前数据,node是当前树形节点