I'm new to Nuxt - converted my vue app to it, and got it working on production: gameslate.io
The app is using the asyncData
method to get the list of games - however the full layout isn't being rendered the server...
If you view the page source you'll see that Nuxt is putting all of the data in window.__NUXT__
, but there's no grid html.
How do I render the full layout on the server after getting data with asyncData
?
Otherwise, google can't crawl the game lists - this becomes pretty useless for SEO... (checkout twitter's page source - it loads the entire page including dynamic content)
This is the "home" page component that makes the asyncData call (simplified):
<template>
<div>things</div> <!-- rendered on server -->
<game-grid :games="games"></game-grid> <!-- rendered in browser -->
</template>
<script>
export default {
data() {
return {
games: []
}
}
async asyncData() {
let games = await getGames(filters);
return { games };
}
}
</script>