mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-25 02:58:27 +08:00
[improvement] Tab: update line style (#719)
This commit is contained in:
parent
18befcb15d
commit
61a9031867
@ -70,6 +70,7 @@
|
|||||||
height: 2px;
|
height: 2px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: @red;
|
background-color: @red;
|
||||||
|
border-radius: 2px 0 2px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--line {
|
&--line {
|
||||||
|
@ -120,7 +120,7 @@ VantComponent({
|
|||||||
|
|
||||||
this.getRect('.van-tab', true).then(rects => {
|
this.getRect('.van-tab', true).then(rects => {
|
||||||
const rect = rects[this.data.active];
|
const rect = rects[this.data.active];
|
||||||
const width = this.data.lineWidth || rect.width;
|
const width = this.data.lineWidth || (rect.width / 2);
|
||||||
let left = rects
|
let left = rects
|
||||||
.slice(0, this.data.active)
|
.slice(0, this.data.active)
|
||||||
.reduce((prev, curr) => prev + curr.width, 0);
|
.reduce((prev, curr) => prev + curr.width, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user