Vue判断设备是移动端还是pc端

const isMobile = () => {
                let flag = navigator.userAgent.match( /(phone|pad|pod|iphone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQOBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOs|Symbian|Windows Phone)/i)
                return flag
            }

            if(isMobile()){
                this.isMobile = true
            }else{
                this.isMobile = false
            }

你可能感兴趣的:(Vue判断设备是移动端还是pc端)