-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript definitions #143
Conversation
4c22f10
to
3eeeea5
Compare
Thanks mate :) |
@pi0 is there a new released planned including this? |
@pi0 @IlyaSemenov Aren't these definitions incorrect? axios-module/lib/plugin.template.js Line 39 in eca7298
Don't these $methods unwrap the |
@zerosym You are right, it should be I had soon switched from Nuxt to Ream in my Typescript project so perhaps I never tested them in real use. |
any plans for a module release? |
It is released 😁 |
Many thanks! I was only looking at https://github.com/nuxt-community/axios-module/releases .. |
@pi0 seems like type definitions are not published with the release. I can't see "index.d.ts" in Also will be more standard to publish them in Thanks |
@husayt Really thanks for notifying this problem. I've releases |
@pi0 thank you very much. I can confirm it is working like a charm. |
Hi! I'm having a similar issue with my TSlint throwing an error: async asyncData({params, app}) {
try {
const res = await app.$axios.get('/spaces' );
const space = res.data.data;
return { space };
} catch (err) {
cosnole.log(err);
}
}, Although, the code runs fine in dev mode, but I cannot build the app. Any hints? |
@davision try adding |
Thank you for quick response! Typings are ok. I've created an index.d.ts with |
You can also add
|
This fixes #19 and #75.
Without typescript definitions, this code in
pages/index.vue
:will fail:
Note: due to how Nuxt.js/webpack works, you may need to explicitly import definitions in your project root
index.d.ts
: