解决了th.setAttribute('draggable', true)报th为undefinded的问题

This commit is contained in:
cw 2019-08-09 10:59:06 +08:00
parent 01855fa7c4
commit e65f4cec38
5 changed files with 192 additions and 192 deletions

View File

@ -108,7 +108,7 @@ var TableHeader = function (_Component) {
} else if (type != 'online' && _this.props.draggable) {
// if (!this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
if (!_this.props.draggable) return;
var th = _this.getTargetToTh(targetEvent);
var th = _this.getTargetToType(targetEvent);
th.setAttribute('draggable', true); //添加交换列效果
_this.drag.option = 'dragAble';
_this.currentDome = th;

View File

@ -225,7 +225,7 @@ class TableHeader extends Component {
}else if(type != 'online' && this.props.draggable){
// if (!this.props.draggable || targetEvent.nodeName.toUpperCase() != "TH") return;
if (!this.props.draggable) return;
let th = this.getTargetToTh(targetEvent);
let th = this.getTargetToType(targetEvent);
th.setAttribute('draggable',true);//添加交换列效果
this.drag.option = 'dragAble';
this.currentDome = th;