判断是否为微信浏览器

isWechat () {
  const ua = window.navigator.userAgent.toLowerCase()
  if (ua.match(/micromessenger/i) == 'micromessenger') {
    this.mode = true
  } else {
    this.mode = false
    this.$msg({
      message: '请在手机微信浏览器打开此页面',
      type: 'warning',
      offset: 75,
      mask: true
    })
    return false
  }
},

 

posted on 2022-06-28 15:46  贲风  阅读(140)  评论(0)    收藏  举报