mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore: remove sortChildren
This commit is contained in:
parent
7ed1747de8
commit
bad69d9f3f
@ -1,5 +1,3 @@
|
||||
import { sortChildren } from '../utils/vnodes';
|
||||
|
||||
export function ChildrenMixin(parent, options = {}) {
|
||||
const indexKey = options.indexKey || 'index';
|
||||
|
||||
@ -44,8 +42,6 @@ export function ChildrenMixin(parent, options = {}) {
|
||||
|
||||
const children = [...this.parent.children, this];
|
||||
|
||||
sortChildren(children, this.parent);
|
||||
|
||||
this.parent.children = children;
|
||||
},
|
||||
},
|
||||
|
@ -1,34 +0,0 @@
|
||||
// import { VNode } from 'vue';
|
||||
|
||||
// function flattenVNodes(vnodes: VNode[]) {
|
||||
// const result: VNode[] = [];
|
||||
|
||||
// function traverse(vnodes: VNode[]) {
|
||||
// vnodes.forEach((vnode) => {
|
||||
// result.push(vnode);
|
||||
|
||||
// if (vnode.componentInstance) {
|
||||
// traverse(vnode.componentInstance.$children.map((item) => item.$vnode));
|
||||
// }
|
||||
|
||||
// if (vnode.children) {
|
||||
// traverse(vnode.children);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// traverse(vnodes);
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// TODO
|
||||
// sort children instances by vnodes order
|
||||
export function sortChildren(children: Vue[], parent: Vue) {
|
||||
// const { componentOptions } = parent.$vnode;
|
||||
// if (!componentOptions || !componentOptions.children) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// const vnodes = flattenVNodes(componentOptions.children);
|
||||
// children.sort((a, b) => vnodes.indexOf(a.$vnode) - vnodes.indexOf(b.$vnode));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user