From 61a9031867d0b8c3ce8b551518a1ede235abfa3a Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 9 Oct 2018 14:43:30 +0800 Subject: [PATCH] [improvement] Tab: update line style (#719) --- packages/tabs/index.less | 1 + packages/tabs/index.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/tabs/index.less b/packages/tabs/index.less index b6bbae96..da435dbc 100644 --- a/packages/tabs/index.less +++ b/packages/tabs/index.less @@ -70,6 +70,7 @@ height: 2px; position: absolute; background-color: @red; + border-radius: 2px 0 2px 0; } &--line { diff --git a/packages/tabs/index.ts b/packages/tabs/index.ts index 5ca768d5..ad0ea848 100644 --- a/packages/tabs/index.ts +++ b/packages/tabs/index.ts @@ -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);