fixed table show-header=false bug
This commit is contained in:
parent
060c79588e
commit
f1dfa8ffab
3 changed files with 15 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<br><br><br><br><br>
|
<br><br><br><br><br>
|
||||||
<Table border :columns="columns1" height="500" :data="data1"></Table>
|
<Table border :columns="columns1" height="500" :data="data1"></Table>
|
||||||
<!-- <Table border :columns="columns1" height='300'></Table> -->
|
<!-- <Table border :columns="columns1" height='300'></Table> -->
|
||||||
<!-- <br><br><br><br><br> -->
|
<!-- <br><br><br><br><br> -->
|
||||||
<!-- <Table width="550" height="200" border :columns="columns2" :data="data4"></Table> -->
|
<!-- <Table width="550" height="200" border :columns="columns2" :data="data4"></Table> -->
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
<!-- <br><br><br><br><br> -->
|
<!-- <br><br><br><br><br> -->
|
||||||
<!-- <Table border :columns="columns6" :data="data5"></Table> -->
|
<!-- <Table border :columns="columns6" :data="data5"></Table> -->
|
||||||
<!-- <br><br><br><br><br> -->
|
<!-- <br><br><br><br><br> -->
|
||||||
|
<Table border :show-header='false' :columns="columns7" height="200" :data="data7"></Table>
|
||||||
<Table border :columns="columns7" height="240" :data="data7"></Table>
|
<Table border :columns="columns7" height="240" :data="data7"></Table>
|
||||||
<!-- <br><br><br><br><br> -->
|
<!-- <br><br><br><br><br> -->
|
||||||
<!-- <Table border :columns="columns8" :data="data7" height="200"></Table> -->
|
<!-- <Table border :columns="columns8" :data="data7" height="200"></Table> -->
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack-dev-server --content-base test/ --open --inline --hot --compress --history-api-fallback --port 8081 --config build/webpack.dev.config.js",
|
"dev": "webpack-dev-server --content-base test/ --open --inline --hot --compress --history-api-fallback --port 8081 --config build/webpack.dev.config.js",
|
||||||
|
"dev:s": "webpack-dev-server --content-base test/ --open --inline --hot --compress --history-api-fallback --port 8081 --host 0.0.0.0 --config build/webpack.dev.config.js",
|
||||||
"dist:style": "gulp --gulpfile build/build-style.js",
|
"dist:style": "gulp --gulpfile build/build-style.js",
|
||||||
"dist:dev": "webpack --config build/webpack.dist.dev.config.js",
|
"dist:dev": "webpack --config build/webpack.dist.dev.config.js",
|
||||||
"dist:prod": "webpack --config build/webpack.dist.prod.config.js",
|
"dist:prod": "webpack --config build/webpack.dist.prod.config.js",
|
||||||
|
|
|
@ -573,9 +573,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fixedBody (){
|
fixedBody (){
|
||||||
this.headerWidth = this.$refs.header.children[0].offsetWidth;
|
if (this.$refs.header) {
|
||||||
this.headerHeight = this.$refs.header.children[0].offsetHeight;
|
this.headerWidth = this.$refs.header.children[0].offsetWidth;
|
||||||
this.showHorizontalScrollBar = this.headerWidth>this.$refs.header.offsetWidth;
|
this.headerHeight = this.$refs.header.children[0].offsetHeight;
|
||||||
|
this.showHorizontalScrollBar = this.headerWidth>this.$refs.header.offsetWidth;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.$refs.tbody || !this.data || this.data.length === 0) {
|
if (!this.$refs.tbody || !this.data || this.data.length === 0) {
|
||||||
this.showVerticalScrollBar = false;
|
this.showVerticalScrollBar = false;
|
||||||
}
|
}
|
||||||
|
@ -584,6 +588,10 @@
|
||||||
let bodyEl = bodyContentEl.parentElement;
|
let bodyEl = bodyContentEl.parentElement;
|
||||||
let bodyContentHeight = bodyContentEl.offsetHeight;
|
let bodyContentHeight = bodyContentEl.offsetHeight;
|
||||||
let bodyHeight = bodyEl.offsetHeight;
|
let bodyHeight = bodyEl.offsetHeight;
|
||||||
|
|
||||||
|
if (!this.$refs.header) {
|
||||||
|
this.showHorizontalScrollBar = bodyEl.offsetWidth < bodyContentEl.offsetWidth;
|
||||||
|
}
|
||||||
|
|
||||||
this.showVerticalScrollBar = this.bodyHeight? bodyHeight - (this.showHorizontalScrollBar?this.scrollBarWidth:0) < bodyContentHeight : false;
|
this.showVerticalScrollBar = this.bodyHeight? bodyHeight - (this.showHorizontalScrollBar?this.scrollBarWidth:0) < bodyContentHeight : false;
|
||||||
|
|
||||||
|
@ -597,7 +605,7 @@
|
||||||
}else{
|
}else{
|
||||||
bodyEl.classList.remove(this.prefixCls +'-overflowX');
|
bodyEl.classList.remove(this.prefixCls +'-overflowX');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hideColumnFilter () {
|
hideColumnFilter () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue