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) => {
const routeName = `page-${to.name}`;
document.body.dataset.routeName = routeName;
if (from.name !== undefined) {
document.body.classList.remove(`page-${from.name}`);
}
document.body.classList.add(`page-${to.name}`);
});
export default router;