change to use body page instead of data-set
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user