feat: useWindowSize

This commit is contained in:
FairyEver 2021-10-25 16:52:03 +08:00
parent f17dc4d45d
commit 80e10ebf2b
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import { $ } from 'v-dollar'
import { ref } from 'vue'
import { throttle } from 'lodash-es'
import { onMounted, onUnmounted, onBeforeMount } from 'vue'
@ -10,8 +10,8 @@ import { onMounted, onUnmounted, onBeforeMount } from 'vue'
*/
export function useWindowSize(wait = 30) {
const width = $(0)
const height = $(0)
const width = ref(0)
const height = ref(0)
function update() {
width.value = window.innerWidth