广州矛调粤政易端
xusd
7 days ago d27794814b69d18aeb8ee96a46cae91d5613570c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * @Company: hugeInfo
 * @Author: lwh
 * @Date: 2023-08-01 15:10:43
 * @LastEditTime: 2023-08-01 15:35:34
 * @LastEditors: lwh
 * @Version: 1.0.0
 * @Description: 搜索框
 */
 
import React from 'react';
import { SearchOutlined, } from 'dd-icons';
import { InputItem } from 'dingtalk-design-mobile';
import './index.less';
 
/**
 * onChange: func // 输入框回调
 * value: string // 填写的值
 * placeholder: string // 提示文字
 * onClear: func // 清空回调
 * onClickRightAction: func // 点击右侧按钮回调
 * ButtonTitle: string // 右侧按钮文字
 */
const MySearch = ({ value, onChange, placeholder = '请输入', onClear, onClickRightAction, ButtonTitle = '搜索' }) => {
  return (
    <div className="mySearch">
      <div className="mySearch-search" >
        <SearchOutlined />
        <InputItem placeholder={placeholder} clear value={value} onClear={onClear} onChange={onChange} />
      </div>
      <div style={{ marginLeft: '16px' }} className={`mySearch-scan mySearch-scan-active`} onClick={onClickRightAction}>
        <span>{ButtonTitle}</span>
      </div>
    </div>
  );
};
 
export default MySearch;