This commit is contained in:
oneao committed 2025-06-10 21:27:20 +08:00
commit c570ec514c
550 files changed
+152597

No files matched your search

@@ -0,0 +1,13 @@
// composables/useOnceMounted.ts
import { onMounted, getCurrentInstance } from "vue";
export function useOnceMounted(callback: () => void) {
const instance = getCurrentInstance();
const key = `__mounted_once_${instance?.type.__file || Math.random()}`;
if (!(window as any)[key]) {
(window as any)[key] = true;
onMounted(callback);
}
}