Nuxt.js SSG (Static Site Generator) Get API Data
P粉593536104
P粉593536104 2023-11-16 21:36:07
0
1
865

When building a project using a static site generator, I understand that documentation created in advance is provided to the user.

If there is logic such as using axios to obtain data and display it on the screen when entering the page, is the corresponding API cached or not called?

P粉593536104
P粉593536104

reply all(1)
P粉729436537

You have 2 lifecycle hooks available for fetching data: fetch and asyncData, as shown below: https://nuxtjs.org/docs/features/ data-fetching

Depending on how you organize your project and your needs, SSG will generate content ahead of time, some of which can also be run on the client, for example if you need some authenticated content.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template