mirror of https://github.com/fantasticit/think.git
client: autofous when open search
This commit is contained in:
parent
52ee2a98bb
commit
1233211966
|
@ -66,7 +66,6 @@ const List: React.FC<{ data: IDocument[] }> = ({ data }) => {
|
||||||
|
|
||||||
export const Search = () => {
|
export const Search = () => {
|
||||||
const [visible, toggleVisible] = useToggle(false);
|
const [visible, toggleVisible] = useToggle(false);
|
||||||
// const { data: recentDocs } = useRecentDocuments();
|
|
||||||
const [searchApi, loading] = useAsyncLoading(searchDocument, 10);
|
const [searchApi, loading] = useAsyncLoading(searchDocument, 10);
|
||||||
const [keyword, setKeyword] = useState('');
|
const [keyword, setKeyword] = useState('');
|
||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
|
@ -113,6 +112,7 @@ export const Search = () => {
|
||||||
<div style={{ paddingBottom: 24 }}>
|
<div style={{ paddingBottom: 24 }}>
|
||||||
<div>
|
<div>
|
||||||
<Input
|
<Input
|
||||||
|
autofocus
|
||||||
placeholder={'搜索文档'}
|
placeholder={'搜索文档'}
|
||||||
size="large"
|
size="large"
|
||||||
value={keyword}
|
value={keyword}
|
||||||
|
@ -143,10 +143,6 @@ export const Search = () => {
|
||||||
error={error}
|
error={error}
|
||||||
normalContent={() => <List data={searchDocs} />}
|
normalContent={() => <List data={searchDocs} />}
|
||||||
/>
|
/>
|
||||||
{/* <div style={{ marginTop: 16 }}>
|
|
||||||
<Text type="tertiary">最近访问的文档</Text>
|
|
||||||
<List data={recentDocs} />
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in New Issue