Windows change count: 0
Basic usageListen for the windows dimensions
Hook listening for Windows size changes
<template>
<div>Windows change count: {{ countRef }}</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useWinResize } from 'vue-hooks-plus'
const countRef = ref(0)
useWinResize(() => (countRef.value += 1))
</script>
useWinResize(
handler: (ev: Event) => void,
);
Property | Description | Type | Default |
---|---|---|---|
handler | 处理函数 | (ev: Event) => void | - |