时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
696 B

4 years ago
  1. import Vue from 'vue'
  2. // Development environment
  3. export const isProd = process.env.NODE_ENV === 'production'
  4. // Browser environment sniffing
  5. export const inBrowser = !Vue.prototype.$isServer
  6. export const UA = inBrowser
  7. export const isAndroid = UA
  8. export const isIOS = UA
  9. export const root = typeof window !== 'undefined' ? window : global
  10. // export const inBrowser = !Vue.prototype.$isServer || typeof window !== 'undefined'
  11. // export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
  12. // export const isAndroid = UA && UA.indexOf('android') > 0
  13. // export const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA)
  14. // export const root = typeof window !== 'undefined' ? window : global