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) => {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user