fixed table show-header=false bug
This commit is contained in:
parent
060c79588e
commit
f1dfa8ffab
3 changed files with 15 additions and 5 deletions
|
@ -10,6 +10,7 @@
|
|||
<!-- <br><br><br><br><br> -->
|
||||
<!-- <Table border :columns="columns6" :data="data5"></Table> -->
|
||||
<!-- <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>
|
||||
<!-- <br><br><br><br><br> -->
|
||||
<!-- <Table border :columns="columns8" :data="data7" height="200"></Table> -->
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
],
|
||||
"scripts": {
|
||||
"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:dev": "webpack --config build/webpack.dist.dev.config.js",
|
||||
"dist:prod": "webpack --config build/webpack.dist.prod.config.js",
|
||||
|
|
|
@ -573,9 +573,13 @@
|
|||
}
|
||||
},
|
||||
fixedBody (){
|
||||
if (this.$refs.header) {
|
||||
this.headerWidth = this.$refs.header.children[0].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) {
|
||||
this.showVerticalScrollBar = false;
|
||||
}
|
||||
|
@ -585,6 +589,10 @@
|
|||
let bodyContentHeight = bodyContentEl.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;
|
||||
|
||||
if(this.showVerticalScrollBar){
|
||||
|
|
Loading…
Add table
Reference in a new issue