filter-dropdown

1.0.1 • Public • Published

filter-dropdown

a filter dropdown look like ant-design table filter

demo

useage

npm i -S filter-dropdown

or

use script tag filter-dropdown.js

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();

/filter-dropdown/

    Package Sidebar

    Install

    npm i filter-dropdown

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    41.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • zhangyu1995