Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuke-dimensions

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-dimensions

屏幕参数

  • 2.1.1-3
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-22.58%
Maintainers
3
Weekly downloads
 
Created
Source

Dimensions

  • category: API
  • chinese: 屏幕参数
  • type: API能力

Nuke UI

nuke-dimensions@ALINPM nuke-dimensions@ALINPM

何时使用

由于 weex 容器不支持 height : 100% ,当你需要获取屏幕宽高的 rem 数值时并设置样式时,需要 Dimensions 组件。

API

Dimensions.get('window/screen')

获取 window 或 screen 的尺寸,默认竖屏

// 获取屏幕宽高的 rem 数值
let { height, width } = Dimensions.get('window');

Dimensions.getWindowInfo(isLandscape)

isLandscape 为 true 时,返回横屏宽高。

需当前页面在容器横屏下打开,否则将出现不可预料的数值

// 获取横屏模式下宽高
let { height, width } = Dimensions.getWindowInfo(true);

Keywords

FAQs

Package last updated on 15 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc