在看https://zhuanlan.zhihu.com/p/...
里面一段代码
var supportsPassive = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassive = true;
}
});
window.addEventListener("test", null, opts);
} catch (e) {}
// Use our detect's results.
// passive applied if supported, capture will be false either way.
elem.addEventListener(
'touchstart',
fn,
supportsPassive ? { passive: true } : false
);
请问window.addEventListener("test", null, opts); 中test表示什么?
杨__羊羊
相关分类