Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

app.setup function in plugins #1667

Answered by patzick
niklaswolf asked this question in Q&A
Sep 15, 2021 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

it's more like Vue-related. Composables are supposed to work inside the setup method. When you want to do some additional stuff on every page and you want to use Nuxt plugin for that you would like to use global setup. But, you're not the only one probably and just overwriting the global setup you might break things. That's why first you're invoking the current setup method, you get the response from that, doing your own logic and return the combined result of that action.

So as a summary
You need to do this only if you're adding nuxt plugin and want to invoke some composables logic inside

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by niklaswolf
Comment options

You must be logged in to vote
3 replies
@patzick
Comment options

@K3vinF
Comment options

@K3vinF
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants