export default class DeviceType { static install(Vue) { Vue.prototype.$deviceType = new this() } constructor() { this.ios = false this.android = false this.pc = false this.ios = false this.ua = '' if (window) { this.ua = window && window.navigator && window.navigator.userAgent || '' } if (/(iPhone|iPad|iPod|iOS)/i.test(this.ua)) { this.ios = true } else if (/(Android)/i.test(this.ua)) { this.android = true } else { this.pc = true } } isIos(){ return this.ios } isAndroid() { return this.android } isMobile() { return this.ios || this.android } isPC() { return this.pc } isWx() { } }