@mahdikhashan/use-window-resize
v0.1.1
Published
A Vue.js 3 hook to listen to window resize event
Downloads
2
Maintainers
Readme
use-window-resize
Custom hook for Vue 3 to get page height and width
Demo
Installation
npm install --save @mahdikhashan/use-window-resize
How to use
add the custom directive to you component
<template>
<div class="main">
Page width {{ width }} and height {{ height }}
</div>
</template>
<script setup>
import { useWindowResize } from '@mahdikhashan/use-window-resize'
const { width, height } = useWindowResize(1)
</script>
Contributing
If you want to contribute to this project simply fork it and clone it then run
npm i
in the root of the project, then run
npm run start
to run development server.
Licence and cast
MIT Licence