initial commit

This commit is contained in:
Zoe
2026-01-11 05:04:29 -06:00
commit 0877cc10bd
65 changed files with 5009 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { onMounted, onUnmounted } from 'vue'
import type { Ref } from 'vue'
export const useClickOutside = (target: Ref<HTMLElement | null>, callback: () => void) => {
const onClick = (event: MouseEvent) => {
if (target.value && !target.value.contains(event.target as Node)) {
callback()
}
}
onMounted(() => {
document.addEventListener('click', onClick)
})
onUnmounted(() => {
document.removeEventListener('click', onClick)
})
}