diff options
| author | Eltrac <hi@guhub.cn> | 2025-10-30 11:43:05 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-10-30 11:43:05 +0800 |
| commit | 3c21063026746af5bc1c11335243ea830d607c8b (patch) | |
| tree | b889d5aa89d0f4d06eee69220d3b8415c624284a /layouts/_partials/scripts | |
| parent | 44f0799510713db69dc2c550ca52e5675b32b556 (diff) | |
perf: dynamically load libra.js
Former-commit-id: 11c2cc7e2c8da0278682d6655edaa5b28854b8cd
Diffstat (limited to 'layouts/_partials/scripts')
| -rw-r--r-- | layouts/_partials/scripts/libra-js.html | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/_partials/scripts/libra-js.html b/layouts/_partials/scripts/libra-js.html index 0eea3d07..95e121ed 100644 --- a/layouts/_partials/scripts/libra-js.html +++ b/layouts/_partials/scripts/libra-js.html @@ -1,4 +1,6 @@ <script type="module"> - import LightBox from '/js/libra.min.js'; - const lightbox = new LightBox({ offset: { x: -8 ,y: -80 } }); +document.addEventListener('DOMContentLoaded', async () => { + const { default: LightBox } = await import('/js/libra.min.js'); + const lightbox = new LightBox({ offset: { x: -8, y: -80 } }); +}); </script> |
