fixed(advance-table): light-ui border width cause scrollbar width computed incorrect

This commit is contained in:
JiwenBai 2019-10-11 10:39:08 +08:00
parent f4371053f0
commit 62373a1344
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "0.5.4",
"version": "0.5.5",
"description": "",
"main": "index.js",
"scripts": {

View File

@ -31,7 +31,7 @@
<slot name="table-operation-search-right" />
</div>
</div>
<div class="n-advance-table__tbody">
<div ref="tbodyWrapper" class="n-advance-table__tbody">
<n-table
ref="header"
style="padding:0;border-bottom-left-radius:0;border-bottom-right-radius:0;"
@ -618,8 +618,8 @@ export default {
computeScollBar () {
this.$nextTick(() => {
this.tbodyWidth = this.relTable.offsetWidth
this.scrollBarWidth = this.wrapperWidth - this.tbodyWidth
console.log('TCL: mounted -> this.scrollBarWidth', this.wrapperWidth, this.tbodyWidth)
this.scrollBarWidth = this.tbodyWrapperWidth - this.tbodyWidth
// console.log('TCL: mounted -> this.scrollBarWidth', this.wrapperWidth, this.tbodyWidth)
})
},
computeCustomWidthStl (column) {
@ -658,6 +658,7 @@ export default {
init () {
this.$nextTick(() => {
this.wrapperWidth = this.$refs.tableWrapper.offsetWidth
this.tbodyWrapperWidth = this.$refs.tbodyWrapper.clientWidth
this.computeScollBar()
// console.log(this.relTable.offsetWidth)