mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[new feature] Tabbar: use relation mixin
This commit is contained in:
@@ -15,7 +15,12 @@ export function ChildrenMixin(parent) {
|
||||
created() {
|
||||
const { children } = this.parent;
|
||||
const index = this.parent.slots().indexOf(this.$vnode);
|
||||
children.splice(index === -1 ? children.length : index, 0, this);
|
||||
|
||||
if (index === -1) {
|
||||
children.push(this);
|
||||
} else {
|
||||
children.splice(index, 0, this);
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
|
Reference in New Issue
Block a user