0.3.10 • Published 2 months ago

buerui v0.3.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

buerui

📦 安装

npm install buerui --save

# 或者使用 yarn
yarn add buerui

# 或者使用 cnpm
cnpm install buerui --save

# 或者使用 pnpm
pnpm install buerui --save

⚙️ 配置

SearchList 组件支持以下配置项:

  • url(必需):请求数据的 API 地址。
  • searchSchema(必需):搜索表单的配置数组。
  • tableColumns(必需):表格列的配置数组。

🔨 使用 2

import { SearchList } from 'boolean-ftl';
import { Card } from 'antd';
import { useState, useEffect } from 'react';

const List = () => {
  // 表格列配置
  const tableSchema = [
    {
      title: 'id',
      dataIndex: 'id',
    },
    {
      title: '姓名',
      dataIndex: 'name',
    },
    {
      title: '年龄',
      dataIndex: 'age',
    },
  ];
  // 搜索表单配置
  const searchSchemaArr = [
    {
      label: '输入框',
      type: 'input',
      key: 'input',
    },
    {
      label: '选择框',
      type: 'select',
      key: 'select',
      oplist: [
        {
          name: '选项1',
          value: '1',
        },
        {
          name: '选项2',
          value: '2',
        },
      ],
    },
    {
      label: '时间',
      type: 'rangePicker',
      key: 'rangePicker',
    },
  ];
  return (
    <Card>
      <SearchList
        url="/api/list"
        searchSchema={searchSchemaArr}
        tableColumns={tableSchema}
      />
    </Card>
  );
};
export default List;

API

SearchList Props

属性名类型默认值说明
urlstring (必需)-数据请求的 API 端点 URL
tableColumnsarray (必需)-表格列的定义,包括标题、数据字段等
searchSchemaarray (可选)-搜索表单的配置,用于筛选数据
exportUrlstring (可选)-导出数据的 API 端点 URL
paginationboolean (可选)true是否显示分页器
mergeDataobject (可选)-用于合并数据的配置,包括要合并的列和唯一索引键
useCacheboolean (可选)false是否启用搜索数据的缓存
cacheIdstring (可选)-缓存标识符,用于唯一标识缓存数据
pageSizeKeystring (可选)'limit'列表每页数量的键名
pageKeystring (可选)'page'列表页码的键名
getTableDatafunction (可选)-用于获取列表数据的回调函数
0.3.10

2 months ago

0.3.8

3 months ago

0.3.7

4 months ago

0.3.6

4 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.2.16

4 months ago

0.3.0

4 months ago

0.2.15

4 months ago

0.2.14

5 months ago

0.2.13

5 months ago

0.2.12

5 months ago

0.2.11

5 months ago

0.2.10

5 months ago

0.2.7

5 months ago

0.2.9

5 months ago

0.2.8

5 months ago

0.2.6

5 months ago

0.2.5

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.16

5 months ago

0.1.15

5 months ago

0.1.14

5 months ago

0.1.13

5 months ago

0.1.12

5 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.9

5 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.0

6 months ago

0.0.15

6 months ago

0.0.13

6 months ago