drop 错误也需要抛出事件调用
This commit is contained in:
parent
bdde396727
commit
32b4b620c5
|
@ -310,14 +310,17 @@ var TableHeader = function (_Component) {
|
|||
_this.onDrop = function (e) {
|
||||
if (!_this.props.draggable) return;
|
||||
if (_this.drag && _this.drag.option != 'dragAble') {
|
||||
_this.props.onDrop(e);
|
||||
return;
|
||||
}
|
||||
var event = _utils.Event.getEvent(e),
|
||||
target = _utils.Event.getTarget(event);
|
||||
_this.currentDome.setAttribute('draggable', false); //添加交换列效果
|
||||
|
||||
var data = _this.getCurrentEventData(_this._dragCurrent);
|
||||
if (!data) return;
|
||||
if (!data) {
|
||||
_this.props.onDrop(e);
|
||||
return;
|
||||
}
|
||||
if (!_this.props.onDrop) return;
|
||||
// this.props.onDrop(event,target);
|
||||
_this.props.onDrop(event, { dragSource: _this.currentObj, dragTarg: data });
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
|
@ -488,13 +488,18 @@ class TableHeader extends Component {
|
|||
*/
|
||||
onDrop = (e) => {
|
||||
if (!this.props.draggable) return;
|
||||
if(this.drag && this.drag.option != 'dragAble'){return;}
|
||||
if(this.drag && this.drag.option != 'dragAble'){
|
||||
this.props.onDrop(e);
|
||||
return;
|
||||
}
|
||||
let event = Event.getEvent(e) ,
|
||||
target = Event.getTarget(event);
|
||||
this.currentDome.setAttribute('draggable',false);//添加交换列效果
|
||||
|
||||
let data = this.getCurrentEventData(this._dragCurrent);
|
||||
if(!data)return;
|
||||
if(!data){
|
||||
this.props.onDrop(e);
|
||||
return;
|
||||
}
|
||||
if(!this.props.onDrop)return;
|
||||
// this.props.onDrop(event,target);
|
||||
this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:data});
|
||||
|
|
Loading…
Reference in New Issue