zoukankan      html  css  js  c++  java
  • vue中判断设备是否移动端区分界面进入不同的路由

      mounted() {
        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))) {
          this.$router.push({name:'phonepage'})
          // return;
        }else{
          this.$router.push({name:'pcpage'})
          document.getElementsByTagName('body')[0].className = 'overflowhidden'
          // this.$refs.appidobj.style.backgroundImage = 'url(../../static/pcui/loading/img_bg.png)'
          // this.$refs.appidobj.style.backgroundSize = '100% 105%'
          // setTimeout(()=>{
          //   this.$refs.appidobj.style.backgroundImage = ''
          //   this.$refs.appidobj.style.backgroundSize = ''
          // },500)
        }
      },
  • 相关阅读:
    线性最大子数组的求法(二)
    高难度智力题
    职业规划
    良好的学习习惯
    毕业生面试绝招
    编写Java程序最容易犯的21种错误
    spring02
    spring_01
    用soapUI生成客户端代码
    idea创建git分支
  • 原文地址:https://www.cnblogs.com/huayang1995/p/14898621.html
Copyright © 2011-2022 走看看