2.1.1 • Published 1 year ago

@antdp/fuzzy-query v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

更多参数参考 antd5 Select组件

参数说明类型默认值
columns表格标题TablesProps["columns"]-
request请求(params: any) => Promise<{ label: any, value: any, [s: string]: any }[]>-
debounceTimeout延迟时间number-
2.1.1

1 year ago

2.1.0

1 year ago

2.0.24

1 year ago

2.0.23

2 years ago

2.0.22

2 years ago

2.0.21

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.19

2 years ago

2.0.17

2 years ago

2.0.18

2 years ago

2.0.20

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.11

2 years ago

2.0.7

2 years ago

2.0.12

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-bate6

2 years ago

2.0.0-bate.5

2 years ago

2.0.0-bate.4

2 years ago

2.0.0-bate.4.0

2 years ago

2.0.0-bate.3

2 years ago

2.0.0-bate-2

2 years ago

1.8.25

2 years ago

1.8.26

2 years ago

2.0.0-bate-4.1

2 years ago

1.8.27

2 years ago

2.0.0-bate-1

2 years ago

2.0.0-bate-0

2 years ago

1.8.24

3 years ago