Skip to content

Commit

Permalink
fix(tab-bar): error in calculating the width of tab items (didi#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyan0205 authored Nov 2, 2019
1 parent 2ed1f8a commit aa09643
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/tab-bar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ export default {
let contentWidth = 0
for (let i = 0, len = this.items.length; i < len; i++) {
contentWidth += this.$refs.items[i].offsetWidth
const {width} = this.$refs.items[i].getBoundingClientRect()
contentWidth += width
}
this.contentW = contentWidth
this.$refs.scroller.reflowScroller()
Expand Down

0 comments on commit aa09643

Please sign in to comment.