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粉7294365372023-11-17 11:29:15
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.