lmk123 / dependent-selects

An easy way to create asynchronous multi-level select boxes.

Repository from Github https://github.comlmk123/dependent-selectsRepository from Github https://github.comlmk123/dependent-selects

Dependent Selects

Help you to create dependent selects boxes such as regions (for example, country -> district -> street).

Features

  • Asynchronous, based on Promise
  • 1.2KB only (min+gzip)
  • No UI, so you can (and have to) customize UI by yourself

Usage & Examples

There is an fully example: https://jsfiddle.net/lmk123/8d2x8dLy/

Another example with Vue.js: https://jsfiddle.net/lmk123/40k949en/

Install

npm install dependent-selects --save

In Webpack:

import DependentSelects from 'dependent-selects'

const multi = new DependentSelects(queryFunction)
// ...

In browser:

<script src="node_modules/dependent-selects/dist/dependent-selects.js"></script>
<script>
  var multi = new DependentSelects(queryFunction)
  // ...
</script>

API

Please see the above examples.

License

MIT

About

An easy way to create asynchronous multi-level select boxes.


Languages

Language:JavaScript 66.7%Language:HTML 33.3%