Reputation: 11
Just because it needs to return a Promise?
fetch example in official document
Upvotes: 1
Views: 1515
Reputation: 11
what I know the process is
so we can't use fetch because fetch methods is the native way only on the browser. Correct me if I'm wrong. Thanks.
Upvotes: 0
Reputation: 17621
There no use of fetch in docs that you linked. There only fetch function that defined for nuxt itself.
You can use http fetch instead of axios, but it wont work on node. You will need to use polyfill for node like node-fetch
Basically you can use any library you want to get your data. Axios just used as a most common library that is used for that purpose. There nothing specific to axios in nuxt itself
Upvotes: 3