固定表头th 限制最大宽度
This commit is contained in:
parent
f3383c0675
commit
b6201d7319
|
@ -502,7 +502,7 @@ var TableHeader = function (_Component) {
|
||||||
da.onClick ? thDefaultObj.onClick = function (e) {
|
da.onClick ? thDefaultObj.onClick = function (e) {
|
||||||
da.onClick(da, e);
|
da.onClick(da, e);
|
||||||
} : "";
|
} : "";
|
||||||
return _react2["default"].createElement("th", _extends({}, thDefaultObj, keyTemp, { "data-th-fixed": da.fixed }));
|
return _react2["default"].createElement("th", _extends({}, thDefaultObj, keyTemp, { "data-th-fixed": da.fixed, style: { maxWidth: da.width } }));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,7 +17,7 @@ const columns = [
|
||||||
title: "序号",
|
title: "序号",
|
||||||
dataIndex: "index",
|
dataIndex: "index",
|
||||||
key: "index",
|
key: "index",
|
||||||
width: 80,
|
width: 85,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
render(text, record, index){return index + 1}
|
render(text, record, index){return index + 1}
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ const columns = [
|
||||||
title: "订单编号",
|
title: "订单编号",
|
||||||
dataIndex: "orderCode",
|
dataIndex: "orderCode",
|
||||||
key: "orderCode",
|
key: "orderCode",
|
||||||
width: 100,
|
width: 120,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
*
|
*
|
||||||
* @title 拖拽改变列宽度
|
* @title 拖拽改变列宽度
|
||||||
* @parent 列操作-拖拽 Drag
|
* @parent 列操作-拖拽 Drag
|
||||||
* @description onDropBorder方法为调整列宽后触发的回调函数。注:不支持tree结构的表头、合并表头的table。
|
* @description onDropBorder方法为调整列宽后触发的回调函数。注:不支持tree结构的表头。
|
||||||
* demo1002
|
* demo1002
|
||||||
*/
|
*/
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Icon} from "tinper-bee";
|
|
||||||
|
|
||||||
import Table from '../../src';
|
import Table from '../../src';
|
||||||
import dragColumn from '../../src/lib/dragColumn';
|
import dragColumn from '../../src/lib/dragColumn';
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -816,7 +816,7 @@ class TableHeader extends Component {
|
||||||
className:`${thClassName} ${fixedStyle}`,
|
className:`${thClassName} ${fixedStyle}`,
|
||||||
};
|
};
|
||||||
da.onClick ?thDefaultObj.onClick = (e)=>{da.onClick(da, e)}:"";
|
da.onClick ?thDefaultObj.onClick = (e)=>{da.onClick(da, e)}:"";
|
||||||
return (<th {...thDefaultObj} {...keyTemp} data-th-fixed={da.fixed} />)
|
return (<th {...thDefaultObj} {...keyTemp} data-th-fixed={da.fixed} style={{maxWidth: da.width}}/>)
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue