@dom-utils/selector-path
返回给定元素的唯一选择器
此工程被克隆并修改为 微型新闻/css-path 仓库.
使用量
import { getSelectorPath } from '@dom-utils/selector-path'
getSelectorPath(node);
选项
- 使用分类Name
- 根节点
- 缩小
- 使用节点ID
选项使用
getSelectorPath(node, { useClassName: true, minify: true , useNodeId: true })