docs: use indexOf instead of search

fix #6962
This commit is contained in:
Wei Zhu 2017-07-26 13:24:58 +08:00
parent 8e496966cf
commit 90511c3261

View File

@ -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 ? (