Files
rrweb/docs/recipes/pagination.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

24 lines
692 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.
# 异步加载数据
当录制的数据较多时,一次性加载至回放页面可能带来较大的网络开销和较长的等待时间。这时可以采取数据分页的方式,异步地加载数据并回放。
rrweb 中用于实现异步加载数据的 API 非常简单直观:
```js
const replayer = new rrweb.Replayer(events);
replayer.addEvent(NEW_EVENT);
```
只需要调用 `addEvent` 传入新的数据rrweb 就会自动处理其中的时间关系,以最恰当的方式进行回放。
如果需要异步加载多个数据,只需这样使用:
```js
const replayer = new rrweb.Replayer(events);
for (const event of NEW_EVENTS) {
replayer.addEvent(event);
}
```