[improvement] Tab: update line style (#719)

This commit is contained in:
neverland 2018-10-09 14:43:30 +08:00 committed by GitHub
parent 18befcb15d
commit 61a9031867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -70,6 +70,7 @@
height: 2px;
position: absolute;
background-color: @red;
border-radius: 2px 0 2px 0;
}
&--line {

View File

@ -120,7 +120,7 @@ VantComponent({
this.getRect('.van-tab', true).then(rects => {
const rect = rects[this.data.active];
const width = this.data.lineWidth || rect.width;
const width = this.data.lineWidth || (rect.width / 2);
let left = rects
.slice(0, this.data.active)
.reduce((prev, curr) => prev + curr.width, 0);