* 监听页面元素改变并处理 * @param target 需要监听的元素,如果不存在,可以等待它出现 * @param observer_config MutationObserver的配置 * @example Utils.mutationObserver(document.querySelector("div.xxxx"),{ "callback":(mutations, observer)=>{}, "config":{childList:true,attributes:true} }); * @example
(
target: HTMLElement | Node | NodeList | Document,
observer_config: {
/**
* observer的配置
*/
config?: MutationObserverInit;
/**
* (可选)是否主动触发一次
*/
immediate?: boolean;
/**
* (可选)是否仅触发一次
* @default false
*/
once?: boolean;
/**
* 触发的回调函数
*/
callback: MutationCallback;
}
)
source not stored for this graph (policy: none)
no test coverage detected