mirror of
https://github.com/mmahdium/portfolio.git
synced 2026-08-16 21:14:31 +03:30
Update README and localization files to enhance project description, add error messages, and improve Persian translations.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Demo Route Middleware
|
||||
*
|
||||
* This is a non-global route middleware example that demonstrates
|
||||
* Nuxt's middleware system without affecting actual navigation.
|
||||
*
|
||||
* To use this middleware on a specific page, add:
|
||||
* definePageMeta({ middleware: 'demo' })
|
||||
*
|
||||
* For global middleware, create a file with .global.ts extension.
|
||||
*
|
||||
* Learn more: https://nuxt.com/docs/guide/directory-structure/middleware
|
||||
*/
|
||||
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
// Example: Log navigation (no-op for demo purposes)
|
||||
if (import.meta.dev) {
|
||||
console.log('[Demo Middleware] Navigating from:', from.path, 'to:', to.path)
|
||||
}
|
||||
|
||||
// Example: Conditional redirect (commented out to avoid side effects)
|
||||
// if (to.path === '/restricted') {
|
||||
// return navigateTo('/')
|
||||
// }
|
||||
|
||||
// Allow navigation to continue
|
||||
})
|
||||
Reference in New Issue
Block a user