@antv/s2
Version:
effective spreadsheet render core lib
21 lines • 685 B
JavaScript
/*
* 判断是否是移动端。
* 兼容场景:pc端但是使用mobile配置。
*/
import { DeviceType } from '../common';
export function isMobile(device) {
if (device === DeviceType.MOBILE) {
return true;
}
return /(?:iPhone|iPad|SymbianOS|Windows Phone|iPod|iOS|Android|Mobile|Phone|Tablet)/i.test(navigator.userAgent);
}
export function isIPhoneX() {
// eslint-disable-next-line no-restricted-globals
return (/iPhone/gi.test(navigator.userAgent) &&
window.screen.height === 812 &&
window.screen.width === 375);
}
export function isWindows() {
return /windows/i.test(navigator.userAgent);
}
//# sourceMappingURL=is-mobile.js.map