observe 指定目标节点与回调,目标节点根据 id 指定。
observe
id
observe(selector: string, callback: Function): void;
selector: string;
指定查找目标节点时使用的 id,优先在创建 IntersectionObserver 对象时传入的 component 中查找,查找不到再进行全局查找,全局查找不到则指定失效。
IntersectionObserver
component
callback: (res) => {};