2.1.1 • Published 1 month ago
@antdp/fuzzy-query v2.1.1
FuzzyQuery 模糊查询
依赖安装
npm i @antdp/fuzzy-query
基本使用
import React from 'react';
import { Input, Col, InputNumber, Button, Select ,Form} from 'antd';
import FuzzyQuery from '@antdp/fuzzy-query';
import 'antd/dist/reset.css';
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
延迟时间5s
import React from 'react';
import { Input, Col, InputNumber, Button, Select ,Form} from 'antd';
import FuzzyQuery from '@antdp/fuzzy-query';
import 'antd/dist/reset.css';
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" }}
debounceTimeout={5000}
/>
</div>
);
};
export default Query
API
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
columns | 表格标题 | TablesProps["columns"] | - |
request | 请求 | (params: any) => Promise<{ label: any, value: any, [s: string]: any }[]> | - |
debounceTimeout | 延迟时间 | number | - |
2.1.1
1 month ago
2.1.0
1 month ago
2.0.24
1 month ago
2.0.23
6 months ago
2.0.22
7 months ago
2.0.21
8 months ago
2.0.15
11 months ago
2.0.16
11 months ago
2.0.13
11 months ago
2.0.14
11 months ago
2.0.19
11 months ago
2.0.17
11 months ago
2.0.18
11 months ago
2.0.20
11 months ago
1.9.1
12 months ago
1.9.0
12 months ago
2.0.3
12 months ago
2.0.2
1 year ago
2.0.5
12 months ago
2.0.4
12 months ago
2.0.11
12 months ago
2.0.7
12 months ago
2.0.12
11 months ago
2.0.6
12 months ago
2.0.9
12 months ago
2.0.10
12 months ago
2.0.8
12 months ago
2.0.1
1 year ago
2.0.0
1 year ago
2.0.0-bate6
1 year ago
2.0.0-bate.5
1 year ago
2.0.0-bate.4
1 year ago
2.0.0-bate.4.0
1 year ago
2.0.0-bate.3
1 year ago
2.0.0-bate-2
1 year ago
1.8.25
1 year ago
1.8.26
1 year ago
2.0.0-bate-4.1
1 year ago
1.8.27
1 year ago
2.0.0-bate-1
1 year ago
2.0.0-bate-0
1 year ago
1.8.24
1 year ago