feat(支持自定义列对齐方式):
This commit is contained in:
parent
c155912250
commit
4c4f0ca9cc
|
@ -511,7 +511,8 @@ var Table = function (_Component) {
|
|||
drgHover: column.drgHover,
|
||||
fixed: column.fixed,
|
||||
width: width,
|
||||
dataindex: column.dataIndex
|
||||
dataindex: column.dataIndex,
|
||||
textAlign: column.textAlign
|
||||
};
|
||||
if (column.onHeadCellClick) {
|
||||
cell.onClick = column.onHeadCellClick;
|
||||
|
|
|
@ -111,6 +111,9 @@ var TableCell = function (_Component) {
|
|||
if (column.fixed && !fixed) {
|
||||
className = className + (' ' + clsPrefix + '-fixed-columns-in-body');
|
||||
}
|
||||
if (column.textAlign) {
|
||||
className = className + (' text-' + column.textAlign);
|
||||
}
|
||||
return _react2["default"].createElement(
|
||||
'td',
|
||||
{
|
||||
|
|
|
@ -636,6 +636,11 @@ var TableHeader = function (_Component) {
|
|||
if (lastShowIndex == columIndex) {
|
||||
canDotDrag = "th-can-not-drag";
|
||||
}
|
||||
var thClassName = "" + da.className ? "" + da.className : '';
|
||||
if (da.textAlign) {
|
||||
thClassName += " text-" + da.textAlign;
|
||||
}
|
||||
delete da.textAlign;
|
||||
var keyTemp = {};
|
||||
//避免key为undefined
|
||||
// if(da.dataindex && da.key ===undefined ){
|
||||
|
@ -651,7 +656,7 @@ var TableHeader = function (_Component) {
|
|||
}
|
||||
|
||||
var thDefaultObj = {};
|
||||
var thClassName = "" + da.className ? "" + da.className : '';
|
||||
|
||||
if (draggable) {
|
||||
thClassName += clsPrefix + "-thead th-drag " + thHover + " ";
|
||||
}
|
||||
|
@ -659,6 +664,7 @@ var TableHeader = function (_Component) {
|
|||
thClassName += clsPrefix + "-thead-th " + canDotDrag;
|
||||
}
|
||||
thClassName += " " + fixedStyle;
|
||||
|
||||
if (!da.fixed) {
|
||||
|
||||
return _react2["default"].createElement(
|
||||
|
@ -678,7 +684,7 @@ var TableHeader = function (_Component) {
|
|||
);
|
||||
} else {
|
||||
thDefaultObj = _extends({}, da, {
|
||||
className: da.className + " " + fixedStyle
|
||||
className: thClassName + " " + fixedStyle
|
||||
});
|
||||
da.onClick ? thDefaultObj.onClick = function (e) {
|
||||
da.onClick(da, e);
|
||||
|
|
|
@ -128,13 +128,8 @@ var TableRow = function (_Component) {
|
|||
TableRow.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
||||
if (this.props.treeType) {
|
||||
this.setRowParentIndex();
|
||||
this.setRowHeight();
|
||||
// if(this.props.fixedIndex!== prevProps.fixedIndex){
|
||||
// this.setRowHeight()
|
||||
// }
|
||||
} else if (this.props.index !== prevProps.index) {
|
||||
this.setRowHeight();
|
||||
}
|
||||
this.setRowHeight();
|
||||
};
|
||||
|
||||
TableRow.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "1.6.30",
|
||||
"version": "1.6.31",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
Loading…
Reference in New Issue