fix(Tab): fix init position incorrect (#4521)

* fix(Tab): fix init position incorrect

* style(Tab): prettier
This commit is contained in:
nemo-shen 2021-09-26 15:05:55 +08:00 committed by GitHub
parent 0e60dc1a7e
commit 56ecd55e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,10 +49,6 @@ VantComponent({
type: null, type: null,
value: 0, value: 0,
observer(name) { observer(name) {
if (!this.skipInit) {
this.skipInit = true;
}
if (name !== this.getCurrentName()) { if (name !== this.getCurrentName()) {
this.setCurrentIndexByName(name); this.setCurrentIndexByName(name);
} }
@ -110,10 +106,8 @@ VantComponent({
container: () => this.createSelectorQuery().select('.van-tabs'), container: () => this.createSelectorQuery().select('.van-tabs'),
}); });
if (!this.skipInit) { this.resize();
this.resize(); this.scrollIntoView();
this.scrollIntoView();
}
}); });
}, },