Skip to content

useWindowSize

反应式窗口大小

¥Reactive window size

示例

Infinity x Infinity

用法

¥Usage

js
import { useWindowSize } from '@vueuse/core'

const { width, height } = useWindowSize()

组件用法

¥Component Usage

vue
<template>
  <UseWindowSize v-slot="{ width, height }">
    Width: {{ width }}
    Height: {{ height }}
  </UseWindowSize>
</template>