Blame view

天文台pc/tianwentai-ui/node_modules/dom-helpers/esm/collectElements.js 285 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
  export default function collectElements(node, direction) {
    var nextNode = null;
    var nodes = [];
    nextNode = node ? node[direction] : null;
  
    while (nextNode && nextNode.nodeType !== 9) {
      nodes.push(nextNode);
      nextNode = nextNode[direction] || null;
    }
  
    return nodes;
  }