perf: mobile style adjustment

This commit is contained in:
vben
2020-12-05 16:14:27 +08:00
parent b884654761
commit 1899146f71
13 changed files with 114 additions and 64 deletions

View File

@@ -73,3 +73,9 @@ export function isImageDom(o: Element) {
export const isTextarea = (element: Element | null): element is HTMLTextAreaElement => {
return element !== null && element.tagName.toLowerCase() === 'textarea';
};
export const isMobile = (): boolean => {
return !!navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
);
};