js根据ua判断常用设备

let ua = navigator.userAgent;
Vue.prototype.$isPC = !!!ua.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
Vue.prototype.$isIOS = /iPhone|iPad|iPod/i.test(ua);
Vue.prototype.$isAndroid = /Android/i.test(ua);
Vue.prototype.$isWX = /MicroMessenger/i.test(ua);
Vue.prototype.$isDingTalk = /DingTalk/i.test(ua);
Vue.prototype.$isWxMini = /MicroMessenger/i.test(ua) && /miniProgram/i.test(ua);

js根据ua判断常用设备

上一篇:Kubernetes 创建 pvc error getting claim reference: selfLink was empty, can‘t make refere,kubernetes 1.20版本以后 禁用了 selfLink


下一篇:使用原生JS,实现鼠标点击爱心效果 !!!