mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-21 13:59:15 +08:00
[bugfix] Tab: should not have line animation when inited (#1295)
This commit is contained in:
parent
5c8d8dfe25
commit
a0bfe6959b
@ -104,7 +104,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setLine();
|
this.setLine(true);
|
||||||
this.setTrack();
|
this.setTrack();
|
||||||
this.scrollIntoView();
|
this.scrollIntoView();
|
||||||
},
|
},
|
||||||
@ -148,7 +148,7 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setLine() {
|
setLine(skipTransition?: boolean) {
|
||||||
if (this.data.type !== 'line') {
|
if (this.data.type !== 'line') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -172,15 +172,16 @@ VantComponent({
|
|||||||
|
|
||||||
left += (rect.width - width) / 2;
|
left += (rect.width - width) / 2;
|
||||||
|
|
||||||
|
const transition = skipTransition ? '' : `transition-duration: ${duration}s; -webkit-transition-duration: ${duration}s;`;
|
||||||
|
|
||||||
this.set({
|
this.set({
|
||||||
lineStyle: `
|
lineStyle: `
|
||||||
${height}
|
${height}
|
||||||
width: ${width}px;
|
width: ${width}px;
|
||||||
background-color: ${color};
|
background-color: ${color};
|
||||||
-webkit-transform: translateX(${left}px);
|
-webkit-transform: translateX(${left}px);
|
||||||
-webkit-transition-duration: ${duration}s;
|
|
||||||
transform: translateX(${left}px);
|
transform: translateX(${left}px);
|
||||||
transition-duration: ${duration}s;
|
${transition}
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user