dengqing
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
src/components/HeaderSearch/index.tsx
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import { SearchOutlined } from '@ant-design/icons'; |
|
|
|
import type { InputRef } from 'antd'; |
|
|
|
import { AutoComplete, Input } from 'antd'; |
|
|
|
import useMergedState from 'rc-util/es/hooks/useMergedState'; |
|
|
|
import type { AutoCompleteProps } from 'antd/es/auto-complete'; |
|
|
|
@ -31,7 +32,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => { |
|
|
|
...restProps |
|
|
|
} = props; |
|
|
|
|
|
|
|
const inputRef = useRef<Input | null>(null); |
|
|
|
const inputRef = useRef<InputRef | null>(null); |
|
|
|
|
|
|
|
const [value, setValue] = useMergedState<string | undefined>(defaultValue, { |
|
|
|
value: props.value, |
|
|
|
@ -74,7 +75,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => { |
|
|
|
className={inputClass} |
|
|
|
value={value} |
|
|
|
options={restProps.options} |
|
|
|
onChange={setValue} |
|
|
|
onChange={(completeValue) => setValue(completeValue)} |
|
|
|
> |
|
|
|
<Input |
|
|
|
size="small" |
|
|
|
|