From c1ce115590e2bbc3f60626c3bcbabcb804234bd2 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 30 Mar 2025 14:17:49 +0200 Subject: [PATCH] feat: add dynamtic title --- frontend/js/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/js/main.js b/frontend/js/main.js index e420f00..ede90be 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -7,9 +7,15 @@ import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, Li ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale, ArcElement, LineElement, PointElement) -const app = createApp(App) +router.beforeEach((to, from, next) => { + if (to.meta?.label) { + document.title = `${to.meta.label} - Budget` + } + next() +}) + +const app = createApp(App) app.use(createBootstrap()) app.use(router) - app.mount('#app')