title: Understanding State and Getters in Nuxt.js: Getters won't working
body: <p>i'm new to Vue and Nuxt and i'm building my first website in Universal mode with these framework. </p>
  
  <p>I'm a bit confused on how the store works in nuxt, since following the official documentation i can't achieve what i have in mind.</p>
  
  <p>In my store folder i have placed for now only one file called "products.js", in there i export the state like this:</p>
  
  <pre><code>export const state = () =&gt; ({
  
    mistica: {
      id: 1,
      name: 'mistica'
      }
  })
  </code></pre>
  
  <p>(The object is simplified in order to provide a cleaner explanation)</p>
  
  <p>In the same file i set up a simple getter, for example:</p>
  
  <pre><code>export const getters = () =&gt; ({
  
      getName: (state) =&gt; {
        return state.mistica.name
      }
  })
  </code></pre>
  
  <p>Now, according to the documentation, in the component i set up like this:</p>
  
  <pre><code>computed: {
   getName () {
    return this.$store.getters['products/getName']
   }
  }
  </code></pre>
  
  <p>or either (don't know what to use):</p>
  
  <pre><code>computed: {
   getName () {
    return this.$store.getters.products.getName
   }
  }
  </code></pre>
  
  <p>but when using "getName" in template is "undefined", in the latter case the app is broken and it says "Cannot read property 'getName' of undefined"</p>
  
  <p>Note that in the template i can access directly the state value with "$store.state.products.mistica.name" with no problems, why so?</p>
  
  <p>What am i doing wrong, or better, what didn't i understand?</p>