feat: align with upstream 1.5.9.9

This commit is contained in:
2026-09-12 18:21:11 +08:00
commit 34f0679117
805 changed files with 376275 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
export default defineNuxtPlugin((nuxtApp) => {
if (import.meta.client) {
const { syncTime, now: getSyncedTimestamp, nowDate: getSyncedDate } = useSyncedTime()
// 立即绑定到 globalThis,组件初始化时即可安全调用(同步完成前回退到 Date.now)
if (typeof globalThis !== 'undefined') {
;(globalThis as any).getSyncedTimestamp = getSyncedTimestamp
;(globalThis as any).getSyncedDate = getSyncedDate
}
// 异步同步,不阻塞应用挂载
syncTime().catch(console.error)
}
})