Skip to main content
Version: 24.38.0

Viewport 接口

🌐 Viewport interface

语法

🌐 Signature

export interface Viewport

属性

🌐 Properties

属性

🌐 Property

修饰符

🌐 Modifiers

类型

🌐 Type

描述

🌐 Description

默认

🌐 Default

deviceScaleFactor

optional

number

指定设备缩放因子。更多信息请参见 devicePixelRatio

🌐 Specify device scale factor. See devicePixelRatio for more info.

附注

将此值设置为 0 将会将此值重置为系统默认值。

🌐 Setting this value to 0 will reset this value to the system default.

1

hasTouch

optional

boolean

指定视口是否支持触摸事件。

🌐 Specify if the viewport supports touch events.

false

height

number

以 CSS 像素为单位的页面高度。

🌐 The page height in CSS pixels.

附注

将此值设置为 0 将会将此值重置为系统默认值。

🌐 Setting this value to 0 will reset this value to the system default.

isLandscape

optional

boolean

指定视口是否处于横向模式。

🌐 Specifies if the viewport is in landscape mode.

false

isMobile

optional

boolean

是否考虑了 meta viewport 标签。

🌐 Whether the meta viewport tag is taken into account.

false

width

number

以 CSS 像素为单位的页面宽度。

🌐 The page width in CSS pixels.

附注

将此值设置为 0 将会将此值重置为系统默认值。

🌐 Setting this value to 0 will reset this value to the system default.