@actualwave/dom-walker 中文文档教程
DOM Walker
库构建在 ES6 代理之上,在其核心中使用 TreeWalker 来遍历 HTML DOM。 使用 BrowserDOM 适配器 和 添加扩充 以处理 HTML 元素。 有关详细信息,请查看 TreeWalker 文档。
Usage
从一组 TreeWalker API 中,DOMWalker 仅导出
- addAugmentations() -- add more augmentations.
- resetAugmentations() -- reset augmentations.
- setNamePrefix() -- add more or change prefixes
- create() -- accepts two optional arguments for root node of the tree and adapter which is set by default to BrowserDOM adapter.
DEMO
DOMWalker 的 Demo available here,相比之下,您可以查看 分块搭建的DOMWalker演示
DOM Walker
Library build on ES6 Proxies using TreeWalker in its core for traversing HTML DOM. Uses BrowserDOM adapter and adds augmentations to work with HTML elements. For more information check TreeWalker documentation.
Usage
From set of TreeWalker API, DOMWalker exports only
- addAugmentations() -- add more augmentations.
- resetAugmentations() -- reset augmentations.
- setNamePrefix() -- add more or change prefixes
- create() -- accepts two optional arguments for root node of the tree and adapter which is set by default to BrowserDOM adapter.
DEMO
Demo of DOMWalker available here, in comparison you may check demo of DOMWalker built by parts