@uni/system-info
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

systemInfo

npm

获取系统信息。

支持

browser miniApp wechatMiniprogram bytedanceMicroApp baiduSmartProgram kuaiShouMiniProgram

安装

$ npm install @uni/system-info --save

or

$ npm install @uni/apis --save

示例

import { getInfo, getInfoSync } from '@uni/system-info';

getInfo().then(res => console.log(res));
let res = getInfoSync();

你也可以从大包引入:

import { systemInfo } from '@uni/apis';

systemInfo.getInfo().then(res => console.log(res));
let res = systemInfo.getInfoSync();

返回

成员 类型 描述
pixelRatio number 设备像素比
screenWidth number 屏幕宽度,单位px
screenHeight number 屏幕高度,单位px
windowWidth number 可使用窗口宽度,单位px
windowHeight number 可使用窗口高度,单位px
language string 设置的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
version string 版本号
platform string 客户端平台
微信小程序

Readme

Keywords

none

Package Sidebar

Install

npm i @uni/system-info

Weekly Downloads

42

Version

1.0.11

License

BSD-3-Clause

Unpacked Size

191 kB

Total Files

103

Last publish

Collaborators

  • bunko
  • rax-publisher