Giter VIP home page Giter VIP logo

antdcascadedselect's Introduction

antd连击Select(antd级联多选)

经过近一个月的奋战,公司的项目也接近尾声了,分享一下当时为了需求而写的一个插件吧。

为什么造轮子

首先我们来看一下antd的选择支持多选

antd_select

接着我们来看下antd的级联选择不支持多选(同样支持搜索等功能)

antd_cascader

因为公司的需求需要级联多选,而antd的团队似乎觉得这种情况不多,或者是偷个小懒,不给antd的级联选择预留多选接口,比如说:我要选**下的北京和美国以及南非,在这上个不同层级上的选项,antd只有树选择能够处理,可是树选择也太难看了,无奈之下自己操刀着手开发

cascadedselect

使用

环境:ES6,React,Antd,以及lodash算法库和classnames

下载dist目录文件引入即可

测试

首先安装modulesnpm install

然后直接运行npm start

打开localhost:8080

或者你不想在8080开启,就输入go命令中加入 --inline --port 3000,enjoy youself

算法

概况:为每个Option分配一个储存信息的KEY[0,999999],千分位代表全选的子Option,个分位代表未全选的子Option。 这也决定了每个options的子项不能超过999,但是却带来的是高性能

我上传的是未编译的文件,具体算法见文件,有注释,一时半会说不完

最后

更新不会停止,有任何问题直接issue,但精力有限,如果你需要类似的功能欢迎直接引用,或者fork(fuck?好直接)过去,当需要共同改进,请联系我配置权限

antdcascadedselect's People

Contributors

hanzhangyu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.