mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
up api
This commit is contained in:
parent
82bf118a73
commit
61f061b00f
@ -9,11 +9,8 @@
|
||||
````jsx
|
||||
var Tree = antd.Tree;
|
||||
var TreeNode = Tree.TreeNode;
|
||||
function handleChecked(checked, c) {
|
||||
console.log('checked: ', checked, c );
|
||||
}
|
||||
React.render(
|
||||
<Tree className="myCls" expandAll={true} onChecked={handleChecked}>
|
||||
<Tree className="myCls" defaultExpandAll={true}>
|
||||
<TreeNode title="parent 1">
|
||||
<TreeNode>leaf </TreeNode>
|
||||
<TreeNode title="parent 1-1">
|
||||
|
@ -9,8 +9,11 @@
|
||||
````jsx
|
||||
var Tree = antd.Tree;
|
||||
var TreeNode = Tree.TreeNode;
|
||||
function handleCheck(checked, c, checkedKeys) {
|
||||
console.log('checked: ', checked, c );
|
||||
}
|
||||
React.render(
|
||||
<Tree expandAll={true} checkable={true}>
|
||||
<Tree defaultExpandAll={true} checkable={true} onCheck={handleCheck}>
|
||||
<TreeNode title="parent 1">
|
||||
<TreeNode>leaf </TreeNode>
|
||||
<TreeNode title="parent 1-1">
|
||||
|
@ -11,7 +11,20 @@
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
### Tree props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| checkable | whether support checked | bool | false |
|
||||
| expandAll | expand all treeNodes | bool | false |
|
||||
| checkable | 是否支持选中 | bool | false |
|
||||
|defaultExpandAll | 设置展开所有树节点 | bool | false |
|
||||
|defaultExpandedKeys | 展开指定的树节点 | String[] | false |
|
||||
|defaultCheckedKeys | 默认选中的树节点 | String[] | [] |
|
||||
|onCheck | 点击树节点触发 | function(e:{checked:bool,node,checkedKeys}) | - |
|
||||
|
||||
### TreeNode props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
|disabled | 禁掉响应 | bool | false |
|
||||
|title | 标题 | String | '---' |
|
||||
|key | 被树的selectedKeys或defaultSelectedKeys所用 | String | 内部计算出的节点位置 |
|
||||
|
@ -56,7 +56,7 @@
|
||||
"rc-table": "~3.1.0",
|
||||
"rc-tabs": "~5.2.0",
|
||||
"rc-tooltip": "~2.4.0",
|
||||
"rc-tree": "~0.13.1",
|
||||
"rc-tree": "~0.14.x",
|
||||
"rc-util": "~2.0.3",
|
||||
"react-slick": "~0.6.4"
|
||||
},
|
||||
|
@ -60,26 +60,18 @@
|
||||
.switcher_icon();
|
||||
&:after{
|
||||
.ie-rotate(3);
|
||||
// .rotate(270deg);
|
||||
transform: rotate(270deg) scale(0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
&.@{treePrefixCls}-chk {
|
||||
&.@{treePrefixCls}-checkbox {
|
||||
width: 15px; height: 15px; margin: 0 3px 0 0;
|
||||
background-position:0 0;
|
||||
&-disabled {
|
||||
background-position: 0 -28px;
|
||||
}
|
||||
&.@{treePrefixCls}-checkbox_false_full {background-position:0 0}
|
||||
&.@{treePrefixCls}-checkbox_false_full_focus {background-position:0 -14px}
|
||||
&.@{treePrefixCls}-checkbox_false_part {background-position:0 -28px}
|
||||
&.@{treePrefixCls}-checkbox_false_part_focus {background-position:0 -42px}
|
||||
&.@{treePrefixCls}-checkbox_false_disable {background-position:0 -56px}
|
||||
&.@{treePrefixCls}-checkbox_true_full {background-position:-14px 0}
|
||||
&.@{treePrefixCls}-checkbox_true_full_focus {background-position:-14px -14px}
|
||||
&.@{treePrefixCls}-checkbox_true_part {background-position:-14px -30px}
|
||||
&.@{treePrefixCls}-checkbox_true_part_focus {background-position:-14px -42px}
|
||||
&.@{treePrefixCls}-checkbox_true_disable {background-position:-14px -56px}
|
||||
&.@{treePrefixCls}-checkbox-checked {background-position:-14px 0}
|
||||
&.@{treePrefixCls}-checkbox-indeterminate {background-position:-14px -30px}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,10 +81,6 @@
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
&-selected{
|
||||
background-color:#FFE6B0;
|
||||
border:1px #FFB951 solid; opacity:0.8;
|
||||
}
|
||||
&-icon__open {
|
||||
margin-right: 2px;
|
||||
background-position: -110px -16px;
|
||||
|
Loading…
Reference in New Issue
Block a user