tree-transfer icon indicating copy to clipboard operation
tree-transfer copied to clipboard

关于label属性的报错

Open WU731642061 opened this issue 4 years ago • 0 comments

作者,你好: 文档中提供了label属性,您的说明中是和element tree的使用方法一样,但是实际使用中,当label的值为function时,filterNodeTofilterNodeFrom 中的 data[this.defaultProps.label].indexOf(value) !== -1 会报错。 我粗糙的处理了一下 if (typeof this.defaultProps.label === 'function') { return this.defaultProps.label(data).indexOf(value) !== -1; } if (typeof this.defaultProps.label === 'string') { return data[this.defaultProps.label].indexOf(value) !== -1; } 但是element中的传参还支持node,希望您这边能够修复一下。谢谢

WU731642061 avatar Aug 11 '20 02:08 WU731642061