修改数据结构

This commit is contained in:
zyronon
2023-09-07 18:47:57 +08:00
parent c663f6f90e
commit cf14d527dc
10 changed files with 163 additions and 380 deletions

7
src/hooks/useEvent.ts Normal file
View File

@@ -0,0 +1,7 @@
// event.js
import {onMounted, onUnmounted} from 'vue'
export function useEventListener(type: string, listener: EventListenerOrEventListenerObject) {
onMounted(() => window.addEventListener(type, listener))
onUnmounted(() => window.removeEventListener(type, listener))
}