From 606ed5d901079b5fb90f5041d45884ef9aa8a427 Mon Sep 17 00:00:00 2001 From: liushaozhen <804199994@qq.com> Date: Tue, 24 Mar 2020 14:37:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(bee-table):=20TableCell=E5=8E=BB=E6=8E=89Fr?= =?UTF-8?q?ament?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/TableCell.js | 29 +++++++++++++---------------- package.json | 2 +- src/TableCell.js | 33 ++++++++++++++------------------- 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/build/TableCell.js b/build/TableCell.js index 99552f2..51ae016 100644 --- a/build/TableCell.js +++ b/build/TableCell.js @@ -428,23 +428,20 @@ var TableCell = function (_Component) { if (colMenu) { className += ' u-table-inline-icon'; } + if (colSpan == 0) return null; return _react2["default"].createElement( - _react.Fragment, - null, - colSpan == 0 ? null : _react2["default"].createElement( - 'td', - { - colSpan: colSpan, - rowSpan: rowSpan, - className: className, - onClick: this.handleClick, - title: title, - style: _extends({ maxWidth: column.width, color: fontColor, backgroundColor: bgColor }, column.style) }, - indentText, - expandIcon, - text, - colMenu - ) + 'td', + { + colSpan: colSpan, + rowSpan: rowSpan, + className: className, + onClick: this.handleClick, + title: title, + style: _extends({ maxWidth: column.width, color: fontColor, backgroundColor: bgColor }, column.style) }, + indentText, + expandIcon, + text, + colMenu ); }; diff --git a/package.json b/package.json index a481465..7779c29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "2.2.42", + "version": "2.2.43", "description": "Table ui component for react", "keywords": [ "react", diff --git a/src/TableCell.js b/src/TableCell.js index b5df905..cd9eecb 100644 --- a/src/TableCell.js +++ b/src/TableCell.js @@ -1,4 +1,4 @@ -import React, { Component,Fragment } from 'react'; +import React, { Component } from 'react'; import PropTypes from 'prop-types'; import objectPath from 'object-path'; import i18n from './lib/i18n'; @@ -280,24 +280,19 @@ class TableCell extends Component{ if(colMenu){ className += ' u-table-inline-icon' } - return ( - - { - colSpan==0?null: - {indentText} - {expandIcon} - {text} - {colMenu} - - } - - ); + if(colSpan==0)return null; + return + {indentText} + {expandIcon} + {text} + {colMenu} + } };