CSR-1439 comment to describe lastNavPage setting
This commit is contained in:
parent
6a53856fbf
commit
c7adf2d9a7
1 changed files with 4 additions and 0 deletions
|
|
@ -161,7 +161,11 @@ const router = createRouter({
|
||||||
//---------------------------------------------------------- Router Functions ----------------------------------------------------------
|
//---------------------------------------------------------- Router Functions ----------------------------------------------------------
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
// Set the lastNavigationPage to the current page name for accurate tracking of page navigations.
|
||||||
|
// Since beforeEach() can be triggered before navigation resolution, to.name may sometimes be "root".
|
||||||
|
// In such cases, getPageName() from the analyticsMixin is used to accurately get the current page name.
|
||||||
router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name;
|
router.lastNavigationPage = to.name == "root" ? analyticsMixin.methods.getPageName() : to.name;
|
||||||
|
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue