A Mutliple-Level Dropdown Implement with React.
import Dropdown from './src/Dropdown';
import '../src/Dropdown.css'; // require css-loader
// ...
const App = () => (
<Dropdown
list={[]}
onChange={(selected) => console.log(selected)}
/>
);
// ...
npm install
npm start
# open http://localhost:8080/example.html in your browser
Default: false
The dropdown menu always show, if showDropdown
is true.
Default: []
If node is in the first level mene, parentId
is null
.
onChange(dataId, item, path): void
It will be fired on click one node.
onEnter(dataId, item, path): void
It will be fired on mouse enter one node.
isNodeClickable(item): bool
It's used to check nodes if clickable.
Default: Select...
The dropdown holder default show text.
Default: 160
The dropdown holder default width.
MPL-2.0