From 4178707ee5cfb99496e07bcb15a844809c137759 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sun, 19 Apr 2026 11:27:25 +0200 Subject: [PATCH] feat: enhance loading time (hom.custom.md) and prefetching Fix part of #330 --- index.html | 6 ++++++ src/pages/Home.page.vue | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 938ce6fd..72696ce2 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,12 @@ + + + + + + diff --git a/src/pages/Home.page.vue b/src/pages/Home.page.vue index 14c271c1..d2d7e1fa 100644 --- a/src/pages/Home.page.vue +++ b/src/pages/Home.page.vue @@ -14,12 +14,6 @@ const base = import.meta.env.BASE_URL ?? '/'; const homeCustomMarkdown = ref(''); -fetch(`${base}home.custom.md`).then((r) => { - if (r.ok) { - r.text().then(t => homeCustomMarkdown.value = t); - } -}); - const { t } = useI18n(); const toolStore = useToolStore(); @@ -127,6 +121,16 @@ onMounted(() => { ); loadingObserver.observe(loadingIndicator); } + + fetch(`${base}home.custom.md`).then((r) => { + if (r.ok) { + r.text().then((t) => { + if (t) { + homeCustomMarkdown.value = t; + } + }); + } + }); }); });