Static GitHub Issues

[690] Problems with async data in pages template

prev: Hope the nuxt.render method has 'data' parameter
next: trying to run latest from master

I'm at /loja/pages/index.vue This is my code:

<template>
	<div>
	  <template-home></template-home>
	  {{produtos}}
    </div>
</template>

<script>
  import TemplateHome from '~/components/default/Templates/Home'
  import {$get} from '~/.nuxt-helpers/axios';
  import axios from 'axios'

  export default {
    components: {
      TemplateHome
    },
    async asyncData({params}) {
        let { produtos } = await axios.get('http://localhost:3010/api/produtos');
        return {produtos}
    }
     
    
  }
</script>

OK, I get that I cannot use asyncData into layouts or components, but why it keeps returning me [Vue warn]: Property or method "produtos" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. ? I'm already using nuxtServerInit to get some initial data to my state, but I think the right way to pass data to components is by props (I might be wrong here). What I'm doing wrong here?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c593">#c593</a>)</em></sub></div>