env.ts 510 B

12345678910111213141516
  1. import { getPlatform } from '@tencentcloud/universal-api';
  2. declare const uni: any;
  3. export const isPC = getPlatform() === 'pc';
  4. export const isH5 = getPlatform() === 'h5';
  5. export const isWeChat = getPlatform() === 'wechat';
  6. export const isApp = getPlatform() === 'app';
  7. export const isUniFrameWork = typeof uni !== 'undefined';
  8. // H5、小程序、app 均认为是手机端产品,如果需要统一手机端 UI 样式,可以直接用 isMobile 控制
  9. export const isMobile = isH5 || isWeChat || isApp;