function finalizeNavigation(toLocation, from, isPush, replace, data) { markAsReady(); } function markAsReady(err) { if (!ready) { ready = !err; setupListeners(); } return err; } function setupListeners() { // avoid setting up listeners twice due to an invalid first navigation if (...
Fixed the problem of invalid routing meta.transition.name configuration Fixed the problem that the right-click tab page panel cannot be closed when clicking on the iframe page and the right-click tab page panel is blocked when on the iframe page Fixed the problem of missing parameters when clic...
import type { NavigationGuard } from 'vue-router'; declare module 'vue-router' { interface RouteMeta { requiresAuth?: boolean; } } export const requiresAuthNavGuard: NavigationGuard = (to) => { if (to.matched.some((record) => record.meta.requiresAuth)) { const { isAuthenticated } =...
To redirect the user to trailing slash routes (or the opposite), you can setup a beforeEach navigation guard that ensures the presence of a trailing slash: router.beforeEach((to, from, next) => { if (to.path.endsWith('/')) next() else next({ path: to.path + '/', query: to....