Skip to content

getWindowSize

Functions

getWindowSize()

getWindowSize(excludeScrollbar?): Object

获取窗口尺寸

Parameters

ParameterTypeDescription
excludeScrollbar?boolean是否排除滚动条,默认包含滚动条大小

Returns

Object

height

height: number = 0

width

width: number = 0

Example

ts
getWindowSize()
// => { width: 1920, height: 1080 }

// 排除滚动条尺寸
getWindowSize(true)
// => { width: 1910, height: 1080 }