UNPKG

vue-nuxt-permission

Version:

A unified permission system for Vue 3 and Nuxt 3 / Nuxt 4 with directives, guards, and async support.

20 lines (19 loc) 677 B
import { GuardOptions } from '../types'; import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'; /** * Global Permission Guard * ------------------------ * A ready-to-use guard for Vue/Nuxt router. * * Example: * router.beforeEach((to, from, next) => globalGuard(to, from, next, { * authRoutes, * protectedRoutes, * getAuthState: () => authStore.state, * loginPath: '/login', * homePath: '/' * })) */ export declare const globalGuard: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext, options?: GuardOptions) => Promise<void>; export default globalGuard; //# sourceMappingURL=globalGuard.d.ts.map