Skip to content

jinkelajs/jinkela-cascader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jinkela-Cascader

Install

yarn install jinkela-cascader

Usage

new Cascader([args])

  • args Object Set of configurable options to set. Can have the following fields:

    • defaultValue Any The default value.
    • placeholder String The placeholder text.
    • options Array<option> Cascading options.
  • option Object The cascading option item. Can have the following fields:

    • value Any The item value. Defaults to text.
    • text String The item text. Defaults to value.
    • options Array<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>