From 90511c3261caa36e2da40dacc7767b100171c4e1 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 26 Jul 2017 13:24:58 +0800 Subject: [PATCH] docs: use indexOf instead of search fix #6962 --- components/tree/demo/search.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tree/demo/search.md b/components/tree/demo/search.md index 60460d137d..405960bcca 100644 --- a/components/tree/demo/search.md +++ b/components/tree/demo/search.md @@ -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 ? (