fix: 浏览器IE拖拽不好使

This commit is contained in:
izbz wh 2020-12-10 20:54:53 +08:00
parent 3c3c47db32
commit b581de4fe9
6 changed files with 11769 additions and 3621 deletions

View File

@ -1,3 +1,4 @@
import polyfill from '@babel/polyfill'
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Con, Row, Col } from 'bee-layout';

View File

@ -1,3 +1,4 @@
import polyfill from '@babel/polyfill'
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Con, Row, Col } from 'bee-layout';

15349
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -74,6 +74,7 @@
"prop-types": "^15.6.0"
},
"devDependencies": {
"@babel/polyfill": "^7.12.1",
"babel-jest": "^22.0.4",
"bee-clipboard": "^2.0.0",
"bee-drawer": "0.0.2",

View File

@ -273,7 +273,7 @@ class TableHeader extends Component {
}
let currentObj = this.table.cols[currentIndex];
this.drag.currIndex = currentIndex;
this.drag.oldLeft = event.x;
this.drag.oldLeft = event.clientX;
this.drag.oldWidth = parseInt((currentObj).style.width);
this.drag.minWidth = currentObj.style.minWidth != ""?parseInt(currentObj.style.minWidth):defaultWidth;
this.drag.tableWidth = parseInt(this.table.table.style.width ?this.table.table.style.width:this.table.table.scrollWidth);
@ -344,7 +344,7 @@ class TableHeader extends Component {
if(this.props.dragborder && this.drag.option == "border"){
//移动改变宽度
let currentCols = this.table.cols[this.drag.currIndex];
let diff = (event.x - this.drag.oldLeft);
let diff = (event.clientX - this.drag.oldLeft);
let newWidth = this.drag.oldWidth + diff;
this.drag.newWidth = newWidth > 0 ? newWidth : this.minWidth;
if(newWidth > this.minWidth){