Nuxt/examples/routing/middleware/plugins/add.ts

10 lines
286 B
TypeScript
Raw Normal View History

export default defineNuxtPlugin(() => {
addRouteMiddleware('global-test', () => {
console.log('this global middleware was added in a plugin')
}, { global: true })
addRouteMiddleware('named-test', () => {
console.log('this named middleware was added in a plugin')
})
})