Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/table/src/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export default {
this.$nextTick(() => {
const columnsWidth = {}

if (this.data.length) {
if (this.data.length && this.$refs.body) {
const $td = this.$refs.body.querySelectorAll('tr')[0].querySelectorAll('td')

for (let i = 0; i < $td.length; i++) {
Expand Down
40 changes: 22 additions & 18 deletions src/components/tabs/src/tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,28 @@ export default {
})
},
updateHandle () {
const navWidth = this.$refs.nav.offsetWidth
const containerWidth = this.$refs.navScroll.offsetWidth
const currentOffset = this.getCurrentScrollOffset()

if (containerWidth < navWidth) {
this.prevable = currentOffset !== 0
this.nextable = currentOffset + containerWidth < navWidth
if (navWidth - currentOffset < containerWidth) {
this.setOffset(navWidth - containerWidth)
}
} else {
this.nextable = false
this.prevable = false
if (currentOffset > 0) {
this.setOffset(0)
}
}
}
if(this.$resf.nav && this.$refs.navScroll) {
const navWidth = this.$refs.nav.offsetWidth
const containerWidth = this.$refs.navScroll.offsetWidth
const currentOffset = this.getCurrentScrollOffset()

if (containerWidth < navWidth) {
this.prevable = currentOffset !== 0
this.nextable = currentOffset + containerWidth < navWidth

if (navWidth - currentOffset < containerWidth) {
this.setOffset(navWidth - containerWidth)
}
} else {
this.nextable = false
this.prevable = false

if (currentOffset > 0) {
this.setOffset(0)
}
}
}
}
},
mounted () {
window.addEventListener('resize', this.updateHandle, false)
Expand Down