fix(bee-table): TableCell去掉Frament

This commit is contained in:
liushaozhen 2020-03-24 14:37:58 +08:00
parent 0e21ef0e3b
commit 606ed5d901
3 changed files with 28 additions and 36 deletions

View File

@ -428,23 +428,20 @@ var TableCell = function (_Component) {
if (colMenu) { if (colMenu) {
className += ' u-table-inline-icon'; className += ' u-table-inline-icon';
} }
if (colSpan == 0) return null;
return _react2["default"].createElement( return _react2["default"].createElement(
_react.Fragment, 'td',
null, {
colSpan == 0 ? null : _react2["default"].createElement( colSpan: colSpan,
'td', rowSpan: rowSpan,
{ className: className,
colSpan: colSpan, onClick: this.handleClick,
rowSpan: rowSpan, title: title,
className: className, style: _extends({ maxWidth: column.width, color: fontColor, backgroundColor: bgColor }, column.style) },
onClick: this.handleClick, indentText,
title: title, expandIcon,
style: _extends({ maxWidth: column.width, color: fontColor, backgroundColor: bgColor }, column.style) }, text,
indentText, colMenu
expandIcon,
text,
colMenu
)
); );
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.2.42", "version": "2.2.43",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -1,4 +1,4 @@
import React, { Component,Fragment } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import objectPath from 'object-path'; import objectPath from 'object-path';
import i18n from './lib/i18n'; import i18n from './lib/i18n';
@ -280,24 +280,19 @@ class TableCell extends Component{
if(colMenu){ if(colMenu){
className += ' u-table-inline-icon' className += ' u-table-inline-icon'
} }
return ( if(colSpan==0)return null;
<Fragment> return <td
{ colSpan={colSpan}
colSpan==0?null:<td rowSpan={rowSpan}
colSpan={colSpan} className={className}
rowSpan={rowSpan} onClick={this.handleClick}
className={className} title={title}
onClick={this.handleClick} style={{maxWidth:column.width, color:fontColor, backgroundColor:bgColor, ...column.style}}>
title={title} {indentText}
style={{maxWidth:column.width, color:fontColor, backgroundColor:bgColor, ...column.style}}> {expandIcon}
{indentText} {text}
{expandIcon} {colMenu}
{text} </td>
{colMenu}
</td>
}
</Fragment>
);
} }
}; };