summaryrefslogtreecommitdiff
path: root/src/router
diff options
context:
space:
mode:
authorHelianthella <git@gumi.ca>2020-12-25 21:00:29 -0500
committerHelianthella <git@gumi.ca>2020-12-25 21:05:54 -0500
commit965059649ff6de8849f5091435befddba18ced93 (patch)
treeed8d61f1451fb943fe82e91e3c517d97231f1e92 /src/router
parentaa43f570ae5fe19f3405bff9c800bcaa442c0f33 (diff)
downloadwebsite-965059649ff6de8849f5091435befddba18ced93.tar.gz
website-965059649ff6de8849f5091435befddba18ced93.tar.bz2
website-965059649ff6de8849f5091435befddba18ced93.tar.xz
website-965059649ff6de8849f5091435befddba18ced93.zip
display a skeleton layout while dynamic views are loading
Diffstat (limited to 'src/router')
-rw-r--r--src/router/index.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/router/index.ts b/src/router/index.ts
index 8165667..04828e4 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -49,6 +49,11 @@ const router = createRouter({
routes,
});
+router.beforeResolve((to, from, next) => {
+ self.dispatchEvent(new Event("initial-load"));
+ next();
+});
+
router.afterEach((to,) => {
const mainTitle = document.querySelector("#app > .content > h1");