animation and style

This commit is contained in:
tangly1024.com
2023-03-13 11:50:04 +08:00
parent 124d12c7cd
commit 2749843b0b
19 changed files with 281 additions and 228 deletions

View File

@@ -124,3 +124,30 @@ export const getListByPage = function (list, pageIndex, pageSize) {
pageIndex * pageSize
)
}
/**
* 判断是否移动设备
*/
export const isMobile = () => {
let isMobile = false
if (!isBrowser()) {
return isMobile
}
if (!isMobile && navigator.userAgentData.mobile) {
isMobile = true
}
if (!isMobile && (/Mobi|Android|iPhone/i.test(navigator.userAgent))) {
isMobile = true
}
if (/Android|iPhone|iPad|iPod/i.test(navigator.platform)) {
isMobile = true
}
if (typeof window.orientation !== 'undefined') {
isMobile = true
}
return isMobile
}