change to use body page instead of data-set

This commit is contained in:
2023-04-18 13:01:45 +10:00
parent a26b60e726
commit 4332f389a1

View File

@@ -477,8 +477,10 @@ router.beforeEach(async (to, from, next) => {
}); });
router.afterEach((to, from) => { router.afterEach((to, from) => {
const routeName = `page-${to.name}`; if (from.name !== undefined) {
document.body.dataset.routeName = routeName; document.body.classList.remove(`page-${from.name}`);
}
document.body.classList.add(`page-${to.name}`);
}); });
export default router; export default router;