ant-design/components/tree/demo/checkbox.md

37 lines
829 B
Markdown
Raw Normal View History

2015-08-19 12:18:10 +08:00
# 复选框
2015-08-06 09:17:40 +08:00
- order: 1
提供复选框操作功能。
---
````jsx
var Tree = antd.Tree;
var TreeNode = Tree.TreeNode;
2015-08-19 12:18:10 +08:00
function handleCheck(info) {
console.log('check: ', info);
}
function handleSelect(info) {
console.log('select: ', info);
2015-08-15 23:45:25 +08:00
}
2015-08-06 09:17:40 +08:00
React.render(
2015-08-19 12:18:10 +08:00
<Tree defaultExpandAll={true} checkable={true} onCheck={handleCheck} onSelect={handleSelect}>
2015-08-10 20:23:18 +08:00
<TreeNode title="parent 1">
<TreeNode>leaf</TreeNode>
2015-08-10 20:23:18 +08:00
<TreeNode title="parent 1-1">
<TreeNode title="parent 2-1">
<TreeNode>leaf</TreeNode>
<TreeNode>leaf</TreeNode>
2015-08-06 09:17:40 +08:00
</TreeNode>
<TreeNode>leaf</TreeNode>
<TreeNode>leaf</TreeNode>
2015-08-10 20:23:18 +08:00
</TreeNode>
</TreeNode>
<TreeNode>leaf</TreeNode>
<TreeNode>leaf</TreeNode>
2015-08-10 20:23:18 +08:00
</Tree>
2015-08-06 09:17:40 +08:00
, document.getElementById('components-tree-demo-checkbox'));
````