mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Tab: insert order (#1372)
This commit is contained in:
parent
e25dde299a
commit
cc8951ffcd
@ -49,7 +49,10 @@ export default create({
|
||||
|
||||
created() {
|
||||
this.findParent('van-tabs');
|
||||
this.parent.tabs.push(this);
|
||||
|
||||
const { tabs } = this.parent;
|
||||
const index = this.parent.$slots.default.indexOf(this.$vnode);
|
||||
tabs.splice(index === -1 ? tabs.length : index, 0, this);
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
@ -97,6 +97,7 @@ export default create({
|
||||
|
||||
tabs(tabs) {
|
||||
this.correctActive(this.curActive || this.active);
|
||||
this.scrollIntoView();
|
||||
this.setLine();
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user