Skip to content

Commit

Permalink
docs: use indexOf instead of search
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Jul 26, 2017
1 parent 8e49696 commit 90511c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/tree/demo/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class SearchTree extends React.Component {
render() {
const { searchValue, expandedKeys, autoExpandParent } = this.state;
const loop = data => data.map((item) => {
const index = item.key.search(searchValue);
const index = item.key.indexOf(searchValue);
const beforeStr = item.key.substr(0, index);
const afterStr = item.key.substr(index + searchValue.length);
const title = index > -1 ? (
Expand Down

0 comments on commit 90511c3

Please sign in to comment.