mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
[bugfix] Tab: should scroll to active tab when inited (#2857)
This commit is contained in:
@@ -150,17 +150,11 @@ export default sfc({
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.inited = true;
|
||||
this.handlers(true);
|
||||
});
|
||||
this.onShow();
|
||||
},
|
||||
|
||||
activated() {
|
||||
this.$nextTick(() => {
|
||||
this.handlers(true);
|
||||
this.scrollIntoView(true);
|
||||
});
|
||||
this.onShow();
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
@@ -172,6 +166,14 @@ export default sfc({
|
||||
},
|
||||
|
||||
methods: {
|
||||
onShow() {
|
||||
this.$nextTick(() => {
|
||||
this.inited = true;
|
||||
this.handlers(true);
|
||||
this.scrollIntoView(true);
|
||||
});
|
||||
},
|
||||
|
||||
// whether to bind sticky listener
|
||||
handlers(bind) {
|
||||
const { events } = this;
|
||||
|
Reference in New Issue
Block a user