Files
rrweb/docs/recipes/interaction.zh_CN.md
yz-yu 655f96da61 Update zh_CN Docs (#384)
* update zh_CN guide, with latest API and options

* add receipes

* update receipes and guide

* update #329 add links to README
2026-04-01 12:00:00 +08:00

20 lines
713 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 回放时与 UI 交互
回放时的 UI 默认不可交互,但在特定场景下也可以通过 API 允许用户与回放场景进行交互。
```js
const replayer = new rrweb.Replayer(events);
// 允许用户在回放的 UI 中进行交互
replayer.enableInteract();
// 禁用用户在回放的 UI 中进行交互
replayer.disableInteract();
```
rrweb 使用 CSS 的 `pointer-events: none` 属性禁用交互。
这能够让回放更加稳定,例如避免用户点击回放中的超链接发生跳转等。
如果你希望允许用户交互,例如用户可以在回放时在输入框中进行输入,那么就可以调用 `enableInteract` API但需要对不稳定的场景自行加以处理。