Skip to content

Commit 0f4e400

Browse files
committed
docs(readme): update
1 parent 0197385 commit 0f4e400

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,15 @@ If the `id` is not passed, it will return all the areas' wrap nodes.
264264

265265
#### `highlighter.getIdByDom(node)`
266266

267-
If you have a wrap node, it can return the unique highlight id for you.
267+
If you have a DOM node, it can return the unique highlight id for you. When passing a non-wrapper element, it will find the nearest ancestor wrapper node.
268268

269269
#### `highlighter.getExtraIdByDom(node)`
270270

271-
If you have a wrap node, it can return the extra unique highlight id for you.
271+
If you have a DOM node, it can return the extra unique highlight id for you. When passing a non-wrapper element, it will find the nearest ancestor wrapper node.
272+
273+
#### `highlighter.setOption(opt)`
274+
275+
You can use this API to change the highlighter's options. The parameters' structure is the same as the constructor's. You can pass partial options.
272276

273277
### 4. Event Listener
274278

README.zh_CN.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,15 @@ if (selection.isCollapsed) {
261261

262262
#### 6.3.11. <a name='highlighter.getIdByDomnode'></a>`highlighter.getIdByDom(node)`
263263

264-
传入一个包裹节点,返回该节点对应的高亮区域的唯一 ID。
264+
传入一个 DOM 节点,返回该节点对应的高亮区域的唯一 ID。支持传入非包裹元素。如果是非包裹,则会自动找到最近的祖先包裹元素
265265

266266
#### 6.3.11. <a name='highlighter.getExtraIdByDomnode'></a>`highlighter.getExtraIdByDom(node)`
267267

268-
传入一个包裹节点,返回该节点对应的高亮区域的额外 ID。
268+
传入一个 DOM 节点,返回该节点对应的高亮区域的额外 ID。支持传入非包裹元素。如果是非包裹,则会自动找到最近的祖先包裹元素。
269+
270+
#### 6.3.12. <a name='highlighter.setOptionopt'></a>`highlighter.setOption(opt)`
271+
272+
可以使用该 API 改变实例的配置项,参数结构和构造函数中的一致,支持传入部分参数。
269273

270274
### 6.4. <a name='EventListener'></a>`Event Listener`
271275

0 commit comments

Comments
 (0)