mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-25 19:21:34 +08:00
fix(tab): correct line position in complete mode (#3777)
* fix(tab): correct line position in complete mode fix #3767, fix #3579 * refactor(tabs): remote console.log
This commit is contained in:
parent
e42169ac51
commit
f1ea060b25
@ -225,7 +225,7 @@ VantComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { currentIndex } = this.data;
|
const { currentIndex, ellipsis } = this.data;
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
getAllRect.call(this, '.van-tab'),
|
getAllRect.call(this, '.van-tab'),
|
||||||
@ -241,7 +241,8 @@ VantComponent({
|
|||||||
.slice(0, currentIndex)
|
.slice(0, currentIndex)
|
||||||
.reduce((prev, curr) => prev + curr.width, 0);
|
.reduce((prev, curr) => prev + curr.width, 0);
|
||||||
|
|
||||||
lineOffsetLeft += (rect.width - lineRect.width) / 2;
|
lineOffsetLeft +=
|
||||||
|
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
lineOffsetLeft,
|
lineOffsetLeft,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user