nuxt-community / composition-api

Composition API hooks for Nuxt 2.
https://composition-api.nuxtjs.org
MIT License
709 stars 100 forks source link

docs: How do I register middleware in script setup #781

Closed laurentfirdion closed 1 year ago

laurentfirdion commented 1 year ago

I feel I should be able to register middleware using script setup but I don't see how (maybe it is not possible?) Thanks in advance,

danielroe commented 1 year ago

Unfortunately this can't be supported in Nuxt 2 because middleware is needed to be known before the setup function runs.