mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-18 23:10:51 +01:00
back to flyonui
This commit is contained in:
28
src/plugins/flyonui.client.ts
Normal file
28
src/plugins/flyonui.client.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import 'flyonui/flyonui'
|
||||
|
||||
import type { HSOverlay, IStaticMethods } from 'flyonui/flyonui'
|
||||
declare global {
|
||||
interface Window {
|
||||
HSStaticMethods: IStaticMethods
|
||||
HSOverlay: typeof HSOverlay
|
||||
}
|
||||
}
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const router = useRouter()
|
||||
router.afterEach(async () => {
|
||||
setTimeout(() => {
|
||||
if (window.HSStaticMethods) {
|
||||
window.HSStaticMethods.autoInit()
|
||||
}
|
||||
}, 50)
|
||||
})
|
||||
|
||||
if (import.meta.client) {
|
||||
setTimeout(() => {
|
||||
if (window.HSStaticMethods) {
|
||||
window.HSStaticMethods.autoInit()
|
||||
}
|
||||
}, 50)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user