1.1.0 • Published 7 years ago
jinkela-cascader v1.1.0
Jinkela-Cascader
Install
yarn install jinkela-cascaderUsage
new Cascader(args)
argsObject Set of configurable options to set. Can have the following fields:defaultValueAny The default value.placeholderString The placeholder text.optionsArray<option> Cascading options.
optionObject The cascading option item. Can have the following fields:valueAny The item value. Defaults totext.textString The item text. Defaults tovalue.optionsArray<option> sub-options.
Demo
<script src="https://unpkg.com/jinkela@1.2.19/umd.js"></script>
<script src="https://unpkg.com/jinkela-cascader@1.0.0/index.js"></script>
<script>
addEventListener('DOMContentLoaded', () => {
new Cascader({
options: [
{
text: 'item 1', options: [
{ text: 'item 1.1' },
{ text: 'item 1.2' }
]
},
{ text: 'item 2' }
]
}).to(document.body);
});
</script>