# carefree-fuzzy-query

> 模糊查询 - 加标题展示

Latest version **2.0.4** (published 2025-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install carefree-fuzzy-query
pnpm add carefree-fuzzy-query
yarn add carefree-fuzzy-query
bun add carefree-fuzzy-query
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2025-06-20 |
| First published | 2021-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 38.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sunluxy |

## Links

- npm: https://www.npmjs.com/package/carefree-fuzzy-query
- npm.io page: https://npm.io/package/carefree-fuzzy-query

## Recent versions

- 2.0.4 (latest) — 2025-06-20
- 2.0.3 — 2023-07-17
- 1.0.50 — 2023-03-05
- 2.0.2 — 2023-02-23
- 1.0.49 — 2023-02-23
- 2.0.1 — 2023-02-22
- 2.0.0 — 2023-02-04
- 1.0.48 — 2022-10-09
- 1.0.47 — 2022-09-25
- 1.0.46 — 2022-04-15
- 1.0.45 — 2022-04-09
- 1.0.44 — 2022-04-04
- 1.0.43 — 2022-04-02
- 1.0.42 — 2022-01-12
- 1.0.41 — 2022-01-12
- … 3 more at https://npm.io/package/carefree-fuzzy-query/versions

## README

---
FuzzyQuery 模糊查询
---

### 依赖安装

```bash
 npm i carefree-fuzzy-query
```

### 参数

| 参数            | 说明         | 类型                                                                        |
| :-------------- | :----------- | :-------------------------------------------------------------------------- |
| columns         | 表格 columns | `TablesProps['columns']`                                                    |
| request         | 请求         | `( params: any) => Promise<{ label: any; value: any; [s: string]: any }[]>` |
| debounceTimeout | 延迟时间     | `number`                                                                    |
| tipWidth        | 提示框 宽度  | `number`                                                                    |

[更多参数](https://ant.design/components/select-cn/#API)

**类型**

```ts
export interface FuzzyQueryProps extends SelectProps<any> {
  /** 表格标题 */
  columns?: TablesProps['columns'];
  /** 请求 */
  request: (
    params: any,
  ) => Promise<{ label: any; value: any; [s: string]: any }[]>;
  /** 延迟时间 */
  debounceTimeout?: number;
  /** 提示框 宽度 */
  tipWidth?: number;
}
```

### 案例

```tsx
import 'antd/dist/reset.css';
import FuzzyQuery from 'carefree-fuzzy-query';
import React from 'react';

const Query = () => {
  const [value, setValue] = React.useState([]);
  // 根据key模糊查询组织
  const selectLike = async () => {
    return Array.from({ length: 20 }).map((_, index) => {
      return {
        label: `名称---${index}`,
        phone: index,
      };
    });
  };
  return (
    <div>
      <FuzzyQuery
        request={selectLike}
        mode="multiple"
        value={value}
        onChange={setValue}
        placeholder="请选择"
        columns={[
          { dataIndex: 'label', title: '用户名' },
          { dataIndex: 'phone', title: '电话' },
        ]}
        fieldNames={{ value: 'phone' }}
      />
    </div>
  );
};
export default Query;
```

---
_Source: https://npm.io/package/carefree-fuzzy-query · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
