forked from github/dataease
Merge pull request #9098 from dataease/pr@dev-v2@perf_pad_recognition
perf: pad自动识别为pc端布局
This commit is contained in:
commit
9b26439917
@ -88,10 +88,18 @@ export const isPlatformClient = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isMobile() {
|
export function isMobile() {
|
||||||
return navigator.userAgent.match(
|
return (
|
||||||
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
navigator.userAgent.match(
|
||||||
|
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
||||||
|
) && !isTablet()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isTablet() {
|
||||||
|
const userAgent = navigator.userAgent
|
||||||
|
const tabletRegex = /iPad|Silk|Galaxy Tab|PlayBook|BlackBerry|(tablet|ipad|playbook)/i
|
||||||
|
return tabletRegex.test(userAgent)
|
||||||
|
}
|
||||||
export function cutTargetTree(tree: BusiTreeNode[], targetId: string | number) {
|
export function cutTargetTree(tree: BusiTreeNode[], targetId: string | number) {
|
||||||
tree.forEach((node, index) => {
|
tree.forEach((node, index) => {
|
||||||
if (node.id === targetId) {
|
if (node.id === targetId) {
|
||||||
|
Loading…
Reference in New Issue
Block a user