-
Notifications
You must be signed in to change notification settings - Fork 122
Closed as not planned
Description
Hey Nuxt-Team!
I can't get my head around the following issue. When creating a new plugin in Nuxt 2.15.8, I get the object of type Context
injected into the default plugin function like so:
export default function (ctx) {
// I do something here.
}
I have the nuxt axios package installed, so I could do http requests from my plugin like this:
export default function (ctx) {
ctx.$axios(someConfig); // works
}
But, the moment I try to destructure the Context object like this:
export default function ({ $axios }) {
$axios(someConfig); // undefined
}
$axios
is suddenly undefined.
Same behavior when I try to destructure $axios
from the app
property of Context
which was suggested elsewhere.
Thank you for taking the time.
EDIT: I was actually talking about a plugin here, added from a module.
Metadata
Metadata
Assignees
Labels
No labels