Skip to content

Commit

Permalink
fix(SearchTree): 删除调试代码&文档整理 (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr-z committed Mar 2, 2022
1 parent 7ccdb57 commit f7e6a0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 6 additions & 2 deletions packages/react-search-tree/README.md
Expand Up @@ -84,6 +84,7 @@ ReactDOM.render(<Demo />, _mount_);
```

## 自定义空选项

<!--rehype:bgWhite=true&codeSandbox=true&codePen=true-->
```jsx
import React, { useState, useEffect, useRef } from 'react';
Expand All @@ -93,7 +94,11 @@ const Demo = () => {
return(
<>
<SearchTree style={{ width:200 }} />
<SearchTree style={{ width:200,marginTop:5 }} emptyOption={<span>暂无数据..</span>} placeholder="请输入选择"/>
<SearchTree
style={{ width:200,marginTop:5 }}
emptyOption={<span>暂无数据..</span>}
placeholder="请输入选择"
/>
</>
)
}
Expand Down Expand Up @@ -170,7 +175,6 @@ const form=useRef()
return null;
}}
onSubmit={({initial, current}) => {
console.log('current',current)
const errorObj = {};
if (!current.searchTree) {
errorObj.searchTree = '默认需要选择内容,选择入内容';
Expand Down
4 changes: 1 addition & 3 deletions packages/react-search-tree/src/SearchTagInput.tsx
Expand Up @@ -124,9 +124,7 @@ function SearchTagInput<V extends SearchTagInputOption>(props: SearchTagInputPro
<div
onMouseOver={() => renderSelectIcon('enter')}
onMouseLeave={() => renderSelectIcon('leave')}
onClick={() => {
if (innerIsOpen) inputRef.current?.focus();
}}
onClick={() => inputRef.current?.focus()}
style={{ minWidth: 200, maxWidth: 'none', ...style }}
>
<div className={`${prefixCls}-inner`}>
Expand Down
1 change: 0 additions & 1 deletion packages/react-search-tree/src/index.tsx
Expand Up @@ -115,7 +115,6 @@ function SearchTree<V extends SearchTagInputOption>(props: SearchTreeProps<V>) {
let isEmpt = true;
options.forEach((opt) => (isEmpt = isEmpt && !!opt.hideNode));
isEmptySet(isEmpt);
console.log('isEmpt', isEmpt);
};

return (
Expand Down

0 comments on commit f7e6a0c

Please sign in to comment.