判断是否是移动端

//判断是否是移动端

isMobile() {
let flag = 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 flag;
},
if(this.isMobile) {
            this.isPhone = true
        }
        else {
            this.isPhone = false
        }

你可能感兴趣的:(判断是否是移动端)