Skip to content

Commit

Permalink
feat: matchRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jul 4, 2024
1 parent a47a30c commit 805d7ec
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@ export interface RawCommonProps {
*/
quickFind?: boolean;


/**
* 此规则下的所有选择器是否直接从根节点开始匹配
*
* GKD 的原理是监听系统屏幕节点变化 这时候会接收到一个事件节点, 默认从这个节点开始匹配到其子孙节点
*
* 常见情况是: 如果匹配的速度跟不上节点事件数量的产生速度, 下一次匹配的开始节点将变成根节点
*
* 但是如果节点事件产生速度较慢, 比如屏幕上只有一个节点(文本)在变化, 那么开始匹配的节点一直将是这个节点
*
* 此时如果你的选择器的末端属性选择器选择的不是这个节点, 那么匹配将会失败, 即使你能在网页审查工具查询到这个节点
*
* 为了解决这个问题, 你可以设置 matchRoot=true, 这样每次匹配都会从根节点开始匹配
*
* @default false
*/
matchRoot?:boolean

/**
* 单位: 毫秒
*
Expand Down

0 comments on commit 805d7ec

Please sign in to comment.