cascading-select
v1.0.2
Published
Cascading Select Component with ES6
Downloads
9
Readme
CascadingSelect
a cascading dropdown list, demo page.
basic usage
CDN
ES6 (lastest)
http://unpkg.com/cascading-select/lib/index.js
ES6 (with version)
https://unpkg.com/[email protected]/lib/index.js
ES5
https://unpkg.com/[email protected]/lib/index.es5.js
ES5 + uglifyJS
http://npm.elemecdn.com/[email protected]/lib/index.es5.js
npm
npm i cascading-select
const CascadingSelect = require('cascading-select')
quick start
const data = [/* data */]
const select = new CascadingSelect({ data }).to(document.body)
select.onChange = arr => { console.log(arr) }
console.log(select.selected)
data struct
run seed.js to generate test data (browser / nodejs)
or directly see demo page , this page will use random data in each visit.
[
{
"name": "[group name]",
"struct": ["[level-0-name]", "[level-1-name]"],
"data": {
"0": {
"0": [{ "i": "[id]", "n": "[name]" }]
},
"1": {
"[parent id]": [{ "i": "[id]", "n": "[name]" }]
}
}
}
]
documention
todo