2015-08-03 16:07:21 +08:00
|
|
|
# 基本
|
|
|
|
|
|
|
|
- order: 0
|
|
|
|
|
|
|
|
最简单的用法。
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
var Tree = antd.Tree;
|
|
|
|
var TreeNode = Tree.TreeNode;
|
2015-08-18 16:03:13 +08:00
|
|
|
|
2015-08-03 16:07:21 +08:00
|
|
|
React.render(
|
2015-08-15 23:45:25 +08:00
|
|
|
<Tree className="myCls" defaultExpandAll={true}>
|
2015-08-14 23:28:20 +08:00
|
|
|
<TreeNode title="parent 1">
|
2015-08-18 16:03:13 +08:00
|
|
|
<TreeNode>leaf</TreeNode>
|
2015-08-10 20:23:18 +08:00
|
|
|
<TreeNode title="parent 1-1">
|
|
|
|
<TreeNode title="parent 2-1">
|
2015-08-18 16:03:13 +08:00
|
|
|
<TreeNode>leaf</TreeNode>
|
2015-08-03 16:07:21 +08:00
|
|
|
</TreeNode>
|
2015-08-18 16:03:13 +08:00
|
|
|
<TreeNode>leaf</TreeNode>
|
2015-08-10 20:23:18 +08:00
|
|
|
</TreeNode>
|
|
|
|
</TreeNode>
|
2015-08-18 16:03:13 +08:00
|
|
|
<TreeNode>leaf</TreeNode>
|
2015-08-10 20:23:18 +08:00
|
|
|
</Tree>
|
2015-08-03 16:07:21 +08:00
|
|
|
, document.getElementById('components-tree-demo-basic'));
|
|
|
|
````
|