npm.io
2.0.0-beta • Published 5 years ago

universal-getsysteminfosync

Licence
BSD-3-Clause
Version
2.0.0-beta
Deps
1
Size
63 kB
Vulns
0
Weekly
0

getSystemInfoSync

npm npm

获取系统信息。

支持

browser miniApp wechatMiniprogram bytedanceMicroApp

安装

$ npm install universal-getSystemInfoSync --save

or

$ npm install universal-api --save

示例

import getSystemInfoSync from 'universal-getSystemInfoSync';

let res = getSystemInfoSync();

你也可以从大包引入:

import { getSystemInfoSync } from 'universal-api';

方法

getSystemInfoSync()
返回
成员 类型 描述
pixelRatio number 设备像素比
screenWidth number 屏幕宽度,单位px
screenHeight number 屏幕高度,单位px
windowWidth number 可使用窗口宽度,单位px
windowHeight number 可使用窗口高度,单位px
language string 设置的语言
version string 版本号
platform string 客户端平台
/**
 * iframe: true
 */
import React from 'react';
export default () => (
  <iframe style={{
      boxShadow: '0 2px 15px rgba(0,0,0,0.1)',
      width: '375px',
      height: '700px'
    }} src='https://herbox.online/p/109000004/app_1aKtEd7SK?previewZoom=100&view=preview&defaultPage=pages/universal-getsysteminfosync/index&topSlider=false'></iframe>
);
微信小程序