Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangyu1818/filter-dropdown
a filter dropdown look like ant-design table filter
https://github.com/zhangyu1818/filter-dropdown
Last synced: 23 days ago
JSON representation
a filter dropdown look like ant-design table filter
- Host: GitHub
- URL: https://github.com/zhangyu1818/filter-dropdown
- Owner: zhangyu1818
- Created: 2019-04-23T17:19:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:15:37.000Z (about 2 years ago)
- Last Synced: 2024-08-11T08:51:25.548Z (4 months ago)
- Language: JavaScript
- Homepage: http://zhangyu1818.com/filter-dropdown/
- Size: 2.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# filter-dropdown
a filter dropdown look like ant-design table filter
[demo](http://zhangyu1818.com/filter-dropdown/)
## useage
`npm i -S filter-dropdown`
or
use script tag [`filter-dropdown.js`](https://github.com/zhangyu1818/filter-dropdown/releases/download/1.0.0/filter-dropdown.js)
```javascript
const filterDropdown = new FilterDropdown(
// trigger element
document.getElementById("dropdown"),
// data
[
{ name: "id", value: 0 },
{ name: "name", value: 1 },
{ name: "age", value: 2 }
],
// onChange
checked => console.log(checked),
// options
{
okText: "ok",
resetText: "reset",
alignment: "center", // "left","center","right",default "left"
radio: true, // default false
offsetTop: 6 // dropdown top offset,default 0
}
);
// destroy
filterDropdown.destroy();
// open and close (must be mounted so you should click the trigger element first)
filterDropdown.open();
filterDropdown.close();
```