2023-05-18 09:40:09 +08:00
|
|
|
import React from 'react';
|
2024-01-14 17:15:39 +08:00
|
|
|
import { AudioOutlined } from '@ant-design/icons';
|
2023-07-28 16:17:43 +08:00
|
|
|
import { Input, Space } from 'antd';
|
2024-07-10 18:28:11 +08:00
|
|
|
import type { GetProps } from 'antd';
|
|
|
|
|
|
|
|
type SearchProps = GetProps<typeof Input.Search>;
|
2022-11-09 12:28:04 +08:00
|
|
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
|
|
|
const suffix = (
|
|
|
|
<AudioOutlined
|
|
|
|
style={{
|
|
|
|
fontSize: 16,
|
2023-05-18 09:40:09 +08:00
|
|
|
color: '#1677ff',
|
2022-11-09 12:28:04 +08:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
2023-08-28 14:42:36 +08:00
|
|
|
const onSearch: SearchProps['onSearch'] = (value, _e, info) => console.log(info?.source, value);
|
2022-11-09 12:28:04 +08:00
|
|
|
|
|
|
|
const App: React.FC = () => (
|
|
|
|
<Space direction="vertical">
|
|
|
|
<Search placeholder="input search text" onSearch={onSearch} style={{ width: 200 }} />
|
|
|
|
<Search placeholder="input search text" allowClear onSearch={onSearch} style={{ width: 200 }} />
|
|
|
|
<Search
|
|
|
|
addonBefore="https://"
|
|
|
|
placeholder="input search text"
|
|
|
|
allowClear
|
|
|
|
onSearch={onSearch}
|
|
|
|
style={{ width: 304 }}
|
|
|
|
/>
|
|
|
|
<Search placeholder="input search text" onSearch={onSearch} enterButton />
|
|
|
|
<Search
|
|
|
|
placeholder="input search text"
|
|
|
|
allowClear
|
|
|
|
enterButton="Search"
|
|
|
|
size="large"
|
|
|
|
onSearch={onSearch}
|
|
|
|
/>
|
|
|
|
<Search
|
|
|
|
placeholder="input search text"
|
|
|
|
enterButton="Search"
|
|
|
|
size="large"
|
|
|
|
suffix={suffix}
|
|
|
|
onSearch={onSearch}
|
|
|
|
/>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default App;
|