From 32b4b620c5a0ea2a71fa72af526885c46fc90320 Mon Sep 17 00:00:00 2001 From: jonyshi Date: Tue, 27 Aug 2019 15:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=20drop=20=E9=94=99=E8=AF=AF=E4=B9=9F=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=8A=9B=E5=87=BA=E4=BA=8B=E4=BB=B6=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/TableHeader.js | 7 +++++-- package.json | 2 +- src/TableHeader.js | 11 ++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/TableHeader.js b/build/TableHeader.js index 5e265ea..7927e12 100644 --- a/build/TableHeader.js +++ b/build/TableHeader.js @@ -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 }); diff --git a/package.json b/package.json index 7fd5782..2efea1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "2.2.3", + "version": "2.2.4", "description": "Table ui component for react", "keywords": [ "react", diff --git a/src/TableHeader.js b/src/TableHeader.js index e774874..9e4be12 100644 --- a/src/TableHeader.js +++ b/src/TableHeader.js @@ -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});