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", "name": "naive-ui",
"version": "0.5.4", "version": "0.5.5",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

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