1 Star 0 Fork 50

多多 / drip-table

forked from 京东零售 / drip-table 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Drip Table

English | 简体中文 | 官方文档 | 讨论组

GitHub license npm version node yarn document PRs Welcome All Contributors

📖 介绍

DripTable 是京东零售推出的一款用于企业级中后台的动态列表解决方案,项目基于 ReactJSON Schema,旨在通过简单配置快速生成页面动态列表来降低 CMS 页面列表开发难度、提高工作效率。

DripTable 目前包含以下子项目:drip-tabledrip-table-generatordrip-table-driver-antd

各个子项目具体介绍如下:

  • drip-table:动态列表解决方案的核心库,其主要能力是支持符合 JSON Schema 标准的数据自动渲染列表内容。

  • drip-table-generator:一个可视化的用于 DripTable 配置 JSON Schema 标准的配置数据的生成工具。

  • drip-table-driver-antd: 一个 Ant Design UI 组件库主题包。

⬆️ 开始使用

DripTable 分为两种应用场景:配置端和应用端。配置端主要负责通过可视化方式和 low-code 方式进行 JSON Schema 标准数据的生成。应用端的职能则是将 JSON Schema 标准配置数据渲染成动态列表。

配置端

  1. 安装依赖

    配置端依赖应用端,安装前先确保已安装 drip-tabledrip-table-driver-{drivername}

    yarn

    yarn add drip-table-generator

    npm

    npm install --save drip-table-generator
  2. 在文件开头引入依赖

    import DripTableGenerator from "drip-table-generator";
    import "drip-table-generator/dist/index.css";
  3. 在页面中引用

    return <DripTableGenerator />;

    配置端正常渲染效果如下:

    drip-table-generator

应用端

  1. 安装依赖

    同时安装 drip-tabledrip-table 主题包:

    yarn

    yarn add drip-table drip-table-driver-{drivername}

    npm

    npm install --save drip-table drip-table-driver-{drivername}

    目前可选列表如下:

    • drip-table-driver-antd
  2. 在文件开头引入依赖

    // 引入 drip-table
    import DripTable from "drip-table";
    // 引入主题包,以 antd 为例
    import DripTableDriverAntDesign from "drip-table-driver-antd";
    // 引入 ant-design 样式
    import "antd/dist/antd.css";
    // 引入 drip-table 样式
    import "drip-table/dist/index.css";
  3. 引用

    const schema = {
      $schema: "http://json-schema.org/draft/2019-09/schema#",
      configs: {
        size: "middle",
      },
      columns: [
        {
          $id: "id",
          title: "名称",
          "ui:type": "text",
          "ui:props": { mode: "single" },
          type: "string",
          dataIndex: "dataIndexName",
        },
      ],
    };
    return (
      <DripTable
        driver={DripTableDriverAntDesign}
        schema={schema}
        dataSource={[]}
      />
    );

    应用端正常渲染效果如下:

    drip-table-demo

🤝 开发手册

如果您对这个项目感兴趣,欢迎提 ✨issue ,也欢迎 ❤️star 支持一下。

本地运行

  1. 克隆项目

    git clone https://github.com/JDFED/drip-table.git
  2. 安装依赖

    lerna bootstrap
  3. 运行项目

    yarn start
  • 访问 http://localhost:8000
  • drip-table 示例路由:/drip-table/guide/basic-demo
  • drip-table-generator 示例路由:/drip-table-generator/preview

更多命令请查看 DEVELOP 。 官网地址请访问 drip-table

License

MIT License

MIT License Copyright (c) 2021 JD.com, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

是京东零售推出的一款用于企业级中后台的动态列表解决方案,项目基于 React 和 JSON Schema,旨在通过简单配置快速生成页面动态列表来降低 CMS 页面列表开发难度、提高工作效率 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/jiaxingweiyi/drip-table.git
git@gitee.com:jiaxingweiyi/drip-table.git
jiaxingweiyi
drip-table
drip-table
master

搜索帮助