手机端页面跳转

This commit is contained in:
shenyanpei
2021-12-17 17:29:15 +08:00
parent 5190eca53c
commit cdda1c385d
10 changed files with 391 additions and 224 deletions
+11
View File
@@ -0,0 +1,11 @@
/** navigator.userAgent可以获取浏览器信息(类型及系统)
* 获取使用的是手机端还是pc端 */
export function isMobile () {
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
return true // 手机端
} else {
return false // PC端
}
}
export default isMobile