修改 headStyle

This commit is contained in:
yangchch6 2019-07-09 15:18:32 +08:00
parent d4df00c3e8
commit baf562cb99
6 changed files with 20 additions and 17 deletions

View File

@ -1015,10 +1015,6 @@ var Table = function (_Component) {
} }
} }
if (data.length == 0 && hideHeaderScroll) {
//支持 NCC 需求:表格无数据时,去掉表头滚动条 (https://github.com/iuap-design/tinper-bee/issues/207)
headStyle.marginBottom = '-' + this.scrollbarWidth + 'px';
}
if (scroll.y) { if (scroll.y) {
// maxHeight will make fixed-Table scrolling not working // maxHeight will make fixed-Table scrolling not working
// so we only set maxHeight to body-Table here // so we only set maxHeight to body-Table here
@ -1073,6 +1069,11 @@ var Table = function (_Component) {
} }
} }
if (data.length == 0 && hideHeaderScroll) {
//支持 NCC 需求:表格无数据时,去掉表头滚动条 (https://github.com/iuap-design/tinper-bee/issues/207)
headStyle.marginBottom = '-' + this.scrollbarWidth + 'px';
}
var renderTable = function renderTable() { var renderTable = function renderTable() {
var hasHead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; var hasHead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var hasBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var hasBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

File diff suppressed because one or more lines are too long

13
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.1.6-beta.1", "version": "2.1.6-beta.2",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -865,10 +865,6 @@ class Table extends Component {
} }
} }
if(data.length == 0 && hideHeaderScroll){
//支持 NCC 需求:表格无数据时,去掉表头滚动条 (https://github.com/iuap-design/tinper-bee/issues/207)
headStyle.marginBottom = `-${this.scrollbarWidth}px`;
}
if (scroll.y) { if (scroll.y) {
// maxHeight will make fixed-Table scrolling not working // maxHeight will make fixed-Table scrolling not working
// so we only set maxHeight to body-Table here // so we only set maxHeight to body-Table here
@ -926,6 +922,11 @@ class Table extends Component {
} }
} }
if(data.length == 0 && hideHeaderScroll){
//支持 NCC 需求:表格无数据时,去掉表头滚动条 (https://github.com/iuap-design/tinper-bee/issues/207)
headStyle.marginBottom = `-${this.scrollbarWidth}px`;
}
const renderTable = (hasHead = true, hasBody = true) => { const renderTable = (hasHead = true, hasBody = true) => {
const tableStyle = {}; const tableStyle = {};
if (!fixed && scroll.x) { if (!fixed && scroll.x) {