inferno-tree-select
v0.0.5
Published
A select for tree using Inferno
Downloads
1
Maintainers
Readme
Inferno Tree Select
A select for tree using Inferno.
Repository
grauwoelfchen/inferno-tree-select (GitLab.com)
Usage
See example
about detail of usage as Component.
import { render } from 'inferno';
import { h } from 'inferno-hyperscript';
import { TreeSelect } from 'inferno-tree-select';
class MyComponent extedns Component {
...
render() {
const { options } = this.state;
return h(TreeSelect, {
options
, selected: '4'
, onSelect: (node) => { console.log(node); }
});
}
}
Tree data
A node must have label
, value
and children
.
[{
"label": "foo",
"value": "1",
"children": [{
"label": "bar",
"value": "2",
"children": [{
"label": "qux",
"value": "4",
"children": []
}, {
"label": "quux",
"value": "5",
"children": []
}]
}]
}, {
"label": "baz",
"value": "3",
"children": []
}]
Development
Build
% make build
Lint
% make vet:lint
Test
Unit Test
% make test:unit
Browser (EtoE) Test
% make test:etoe
: if you have `xvfb-run` (for Docker on CI etc.)
% xvfb-run make test:etoe
License
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.
See LICENSE.
Inferno Tree Select
Copyright (c) 2018 Yasuhiro Asaka