跪拜 Guibai
← Back to the summary

JD Retail Open-Sources DripTable: Schema-Driven List Rendering for React Admin Panels

Table of Contents


DripTable is a dynamic list solution for enterprise-level back-office systems, launched by JD Retail. The project is based on React and JSON Schema, aiming to quickly generate dynamic list pages through simple configuration, thereby reducing the difficulty of list development and improving work efficiency.

DripTable currently includes the following sub-projects: drip-table and drip-table-generator. The details of each sub-project are as follows:

Image

Advantages

When to Use

Image

DripTable list building example

Image

DripTable list building example

Getting Started

DripTable has two application scenarios: the configuration side and the application side. The configuration side is mainly responsible for generating JSON Schema standard data through visual and low-code methods. The application side renders that JSON Schema configuration data into dynamic lists.

Configuration Side

1 Installing Dependencies

The configuration side depends on the application side. Make sure drip-table is installed first.

"yarn"

yarn add drip-table-generator

"npm"

npm install --save drip-table-generator

2 Import Dependencies at the Top of the File

import DripTableGenerator from "drip-table-generator";
import "drip-table-generator/dist/index.min.css";

3 Reference in the Page

return <DripTableGenerator />;

The normal rendering effect of the configuration side is as follows:

Image

Normal rendering effect of the configuration side

Application Side

1 Installing Dependencies

Install drip-table:

"yarn"

yarn add drip-table

"npm"

npm install --save drip-table

2 Import Dependencies at the Top of the File

// Import drip-table
import DripTable from "drip-table";
// Import drip-table styles
import "drip-table/dist/index.min.css";

3 Reference

const schema = {
  size: "middle",
  columns: [
    {
      key: "columnKey",
      title: "列标题",
      dataIndex: "dataIndexName",
      component: "text",
      options: {
        mode: "single",
      },
    },
  ],
};
return (
  <DripTable
    schema={schema}
    dataSource={[]}
  />
);

The normal rendering effect of the application side is as follows:

Image

Normal rendering effect of the application side

Open Source Repository

Comments

Top 1 from juejin.cn, machine-translated. The original thread is authoritative.

Swot

This library is no longer maintained, right?