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() {
|
||||
this.setLine();
|
||||
this.setLine(true);
|
||||
this.setTrack();
|
||||
this.scrollIntoView();
|
||||
},
|
||||
@ -148,7 +148,7 @@ VantComponent({
|
||||
}
|
||||
},
|
||||
|
||||
setLine() {
|
||||
setLine(skipTransition?: boolean) {
|
||||
if (this.data.type !== 'line') {
|
||||
return;
|
||||
}
|
||||
@ -172,15 +172,16 @@ VantComponent({
|
||||
|
||||
left += (rect.width - width) / 2;
|
||||
|
||||
const transition = skipTransition ? '' : `transition-duration: ${duration}s; -webkit-transition-duration: ${duration}s;`;
|
||||
|
||||
this.set({
|
||||
lineStyle: `
|
||||
${height}
|
||||
width: ${width}px;
|
||||
background-color: ${color};
|
||||
-webkit-transform: translateX(${left}px);
|
||||
-webkit-transition-duration: ${duration}s;
|
||||
transform: translateX(${left}px);
|
||||
transition-duration: ${duration}s;
|
||||
${transition}
|
||||
`
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user