防止报width为NAN问题

This commit is contained in:
wanghaoo 2018-10-08 16:36:44 +08:00
parent e374da6180
commit 7d2f11b4fa
3 changed files with 5 additions and 5 deletions

4
dist/demo.js vendored
View File

@ -11187,9 +11187,9 @@
}
cols = cols.concat(leafColumns.map(function (c, i, arr) {
var width = c.width;
if (typeof width == 'string' && width.indexOf('%') > -1) {
if (typeof width == 'string' && width.indexOf('%') > -1 && self.contentWidth) {
width = parseInt(self.contentWidth * parseInt(width) / 100);
} else {
} else if (width) {
width = parseInt(width);
}
if (lastShowIndex == i) {

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -546,9 +546,9 @@ class Table extends Component {
}
cols = cols.concat(leafColumns.map((c, i, arr) => {
let width = c.width;
if(typeof(width)=='string' && width.indexOf('%')>-1){
if(typeof(width)=='string' && width.indexOf('%')>-1 && self.contentWidth){
width = parseInt(self.contentWidth * parseInt(width) /100);
}else{
}else if(width){
width = parseInt(width);
}
if (lastShowIndex == i) {