VueUse 是一个组合式API的工具库,支持网页开发的常用功能: 例如窗口宽度、滚动距离、进入可视区、倒计时、复制、调用设备传感器等各种功能的API
中文文档:VueUse中文网
英文文档:Get Started | VueUse
其内置Hook非常好用 ,例如获取设备的宽高:
import { useWindowSize } from '@vueuse/core'
const { width, height } = useWindowSize()
VueUse 是一个组合式API的工具库,支持网页开发的常用功能: 例如窗口宽度、滚动距离、进入可视区、倒计时、复制、调用设备传感器等各种功能的API
中文文档:VueUse中文网
英文文档:Get Started | VueUse
其内置Hook非常好用 ,例如获取设备的宽高:
import { useWindowSize } from '@vueuse/core'
const { width, height } = useWindowSize()