mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
14 lines
387 B
JavaScript
14 lines
387 B
JavaScript
// Test via a getter in the options object to see if the passive property is accessed
|
|
let supportsPassive = false;
|
|
try {
|
|
let opts = Object.defineProperty({}, 'passive', {
|
|
get() {
|
|
supportsPassive = true;
|
|
},
|
|
});
|
|
window.addEventListener('testPassive', null, opts);
|
|
window.removeEventListener('testPassive', null, opts);
|
|
} catch (e) {}
|
|
|
|
export default supportsPassive;
|