判斷是否爲iphoneX

    isIphoneX () {
      let result = false
      let u = navigator.userAgent
      let isIos = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
      if (isIos) {
        if (screen.height === 812 && screen.width === 375) {
          result = true
        }
      }
      return result
    }
相關文章
相關標籤/搜索