[bugfix] Tab: should scroll to active tab when inited (#2857)

This commit is contained in:
neverland
2019-02-26 20:35:13 +08:00
committed by GitHub
parent 2c2d2116fd
commit 6c90d3cf51
3 changed files with 25 additions and 23 deletions

View File

@@ -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;