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() {
|
created() {
|
||||||
this.findParent('van-tabs');
|
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() {
|
mounted() {
|
||||||
|
@ -97,6 +97,7 @@ export default create({
|
|||||||
|
|
||||||
tabs(tabs) {
|
tabs(tabs) {
|
||||||
this.correctActive(this.curActive || this.active);
|
this.correctActive(this.curActive || this.active);
|
||||||
|
this.scrollIntoView();
|
||||||
this.setLine();
|
this.setLine();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user