feat(表头支持滚动条):

This commit is contained in:
wanghaoo 2018-10-30 16:40:25 +08:00
parent 403fc0f6dc
commit e2abf8b8dc
2 changed files with 14 additions and 3 deletions

View File

@ -707,7 +707,8 @@ var Table = function (_Component) {
_props3$scroll = _props3.scroll, _props3$scroll = _props3.scroll,
scroll = _props3$scroll === undefined ? {} : _props3$scroll, scroll = _props3$scroll === undefined ? {} : _props3$scroll,
getBodyWrapper = _props3.getBodyWrapper, getBodyWrapper = _props3.getBodyWrapper,
footerScroll = _props3.footerScroll; footerScroll = _props3.footerScroll,
headerScroll = _props3.headerScroll;
var useFixedHeader = this.props.useFixedHeader; var useFixedHeader = this.props.useFixedHeader;
var bodyStyle = _extends({}, this.props.bodyStyle); var bodyStyle = _extends({}, this.props.bodyStyle);
@ -739,8 +740,18 @@ var Table = function (_Component) {
// Add negative margin bottom for scroll bar overflow bug // Add negative margin bottom for scroll bar overflow bug
var scrollbarWidth = (0, _utils.measureScrollbar)(); var scrollbarWidth = (0, _utils.measureScrollbar)();
if (scrollbarWidth >= 0) { if (scrollbarWidth >= 0) {
(fixed ? bodyStyle : headStyle).marginBottom = '-' + scrollbarWidth + 'px';
(fixed ? bodyStyle : headStyle).paddingBottom = '0px'; (fixed ? bodyStyle : headStyle).paddingBottom = '0px';
//显示表头滚动条
if (headerScroll) {
if (fixed) {
bodyStyle.marginBottom = '-' + scrollbarWidth + 'px';
headStyle.marginBottom = scrollbarWidth + 'px';
} else {
headStyle.marginBottom = '0px';
}
} else {
(fixed ? bodyStyle : headStyle).marginBottom = '-' + scrollbarWidth + 'px';
}
} }
} }

View File

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