image.png
    Input.Search 参考 https://ant.design/components/input-cn#components-input-demo-search-input

    • 回车后触发搜索,不需要防抖处理
    • w-80 参考 tailwindcss = 20rem = 320px ```tsx import React, { memo } from ‘react’; import { bool, func, string } from ‘prop-types’; import { Input } from ‘antd’; import cls from ‘classnames’;

    const { Search } = Input;

    AntdSearch.propTypes = { onSearch: func.isRequired, enterButton: string, placeholder: string, allowClear: bool, }; AntdSearch.defaultProps = { enterButton: ‘搜索’, placeholder: ‘请输入名称搜索’, allowClear: true, };

    function AntdSearch({ className, …props }) {

    return ( ); }

    export default memo(AntdSearch); ```