2.1.56
先进行下载Tree包
npm install --save bee-tree
组件调用
import Tree from 'bee-tree'; const TreeNode = Tree.TreeNode; const defaultProps = { keys: ['0-0-0', '0-0-1'] } class Demo1 extends Component { constructor(props) { super(props); const keys = this.props.keys; this.state = { defaultExpandedKeys: keys, defaultSelectedKeys: keys, defaultCheckedKeys: keys, }; } onSelect(info) { console.log('selected', info); } onCheck(info) { console.log('onCheck', info); } render() { return ( <Tree className="myCls" showLine checkable defaultExpandedKeys={this.state.defaultExpandedKeys} defaultSelectedKeys={this.state.defaultSelectedKeys} defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} > <TreeNode title="parent 1" key="0-0"> <TreeNode title="parent 1-0" key="0-0-0" disabled> <TreeNode title="leaf" key="0-0-0-0" disableCheckbox /> <TreeNode title="leaf" key="0-0-0-1" /> </TreeNode> <TreeNode title="parent 1-1" key="0-0-1"> <TreeNode title={<span style={{ color: '#08c' }}>sss</span>} key="0-0-1-0" /> </TreeNode> </TreeNode> </Tree> ); } } React.render(<Demo1 />, document.getElementById('target'));
<link rel="stylesheet" href="./node_modules/build/bee-tree.css">
import "./node_modules/src/Tree.scss" //或是 import "./node_modules/build/bee-tree.css"
$ npm install -g bee-tools $ git clone https://github.com/tinper-bee/bee-tree $ cd bee-tree $ npm install $ npm run dev
bee-tree2
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
bee-tree
Browser Support
使用
使用单独的Tree包
组件引入
先进行下载Tree包
组件调用
样式引入
API
Tree
TreeNode
快捷键API
开发调试