SUPPORTS_TOUCH
函数签名
typescript
function SUPPORTS_TOUCH() { ... }点击查看源码
js
/**
* 检测触摸事件支持
* @returns 触摸事件支持判断结果
*/
function supportsTouch() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0;
}
// ============ 触摸支持检测 ============
/** 支持触摸事件 */
export const SUPPORTS_TOUCH = supportsTouch();ts
/**
* 检测触摸事件支持
* @returns 触摸事件支持判断结果
*/
function supportsTouch() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0;
}
// ============ 触摸支持检测 ============
/** 支持触摸事件 */
export const SUPPORTS_TOUCH = supportsTouch();如有错误,请提交issue :::