Reputation: 85
For example I have some page in Nuxt:
data() {
return {
items: []
};
},
asyncData() {
return axios.get('site.com/url')
.then((response) => {
return {
items: response.data
};
});
},
Then I run npm run generate
and get statically generated html-page with data (items) from backend server. And when I open this page in browser I see that injected data into the page.
But these items might be updated on the backend so I need to see them once I have got refreshed the page with F5 and without running again npm run generate
.
So looks like I should refetch data in mounted() section. Maybe Nuxt has something more suitable for this?
Upvotes: 0
Views: 280
Reputation: 720
The only option is use crawler: false
property in your nuxt.config.js
file. It will disable static content generation from you dynamic pages. Here is the documentation.
Upvotes: 0