Browse Source

up tree, change drag api, fix drag state

pull/868/head^2
然则 9 years ago
parent
commit
696b3438b8
  1. 4
      components/tree/demo/contextmenu.md
  2. 12
      components/tree/demo/draggable.md
  3. 10
      components/tree/index.md
  4. 2
      package.json

4
components/tree/demo/contextmenu.md

@ -1,8 +1,8 @@
# 基本
# 右键菜单
- order: 0
最简单的用法。
右键菜单示例
---

12
components/tree/demo/draggable.md

@ -45,15 +45,15 @@ const Demo = React.createClass({
expandedKeys: ['0-0', '0-0-0', '0-0-0-0'],
};
},
onTreeDragStart() {
onDragStart() {
},
onTreeDragEnter(info) {
onDragEnter(info) {
// console.log(info);
this.setState({
expandedKeys: info.expandedKeys,
});
},
onTreeDrop(info) {
onDrop(info) {
console.log(info);
const dropKey = info.node.props.eventKey;
const dragKey = info.dragNode.props.eventKey;
@ -108,9 +108,9 @@ const Demo = React.createClass({
<p>drag a node into another node</p>
<div className="draggable-container">
<Tree defaultExpandedKeys={this.state.expandedKeys} openAnimation={{}} draggable
onTreeDragStart={this.onTreeDragStart}
onTreeDragEnter={this.onTreeDragEnter}
onTreeDrop={this.onTreeDrop}>
onDragStart={this.onDragStart}
onDragEnter={this.onDragEnter}
onDrop={this.onDrop}>
{loop(this.state.gData)}
</Tree>
</div>

10
components/tree/index.md

@ -32,11 +32,11 @@
|loadData | 异步加载数据 | function(node)| - |
|onRightClick | 显示右键菜单 | function({event,node}) | - |
|draggable | 设置节点可拖拽(IE>8) | bool | false |
|onTreeDragStart | 开始拖拽时调用 | function({event,node}) | - |
|onTreeDragEnter | dragenter 触发时调用 | function({event,node,expandedKeys}) | - |
|onTreeDragOver | dragover 触发时调用 | function({event,node}) | - |
|onTreeDragLeave | dragleave 触发时调用 | function({event,node}) | - |
|onTreeDrop | drop 触发时调用 | function({event, node, dragNode, dragNodesKeys}) | - |
|onDragStart | 开始拖拽时调用 | function({event,node}) | - |
|onDragEnter | dragenter 触发时调用 | function({event,node,expandedKeys}) | - |
|onDragOver | dragover 触发时调用 | function({event,node}) | - |
|onDragLeave | dragleave 触发时调用 | function({event,node}) | - |
|onDrop | drop 触发时调用 | function({event, node, dragNode, dragNodesKeys}) | - |
### TreeNode props

2
package.json

@ -61,7 +61,7 @@
"rc-tabs": "~5.6.0",
"rc-time-picker": "~1.0.0",
"rc-tooltip": "~3.3.0",
"rc-tree": "^0.25.3",
"rc-tree": "~0.26.1",
"rc-tree-select": "^0.3.3",
"rc-trigger": "~1.0.6",
"rc-upload": "~1.7.0",

Loading…
Cancel
Save