How to generate 100% Static website with Nuxt.js without API request?

懵懂的女人 提交于 2020-03-17 11:47:10

问题


I am testing around with Nuxt.js to generate a static website.

Is it possible to generate a 100% static site when using an API to fetch data, so that one can get rid of the API and requests?

Based on my tests so far that all the files are generated properly and being hosted on the Github Pages and can be reached, except:

  1. When hitting the pages directly via URL bar, no error (expected behavior)
  2. When navigating to the pages via routes, the pages is still sending the request to API (does not exist outside local machine), even though the data has already been fetched and the .html file is generated with the data already during the generate process.

Using asyncData to get the data for the components from the API.

来源:https://stackoverflow.com/questions/51815236/how-to-generate-100-static-website-with-nuxt-js-without-api-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!