title: How to define getters on vuex module?
body: <p>I am trying to improve vuex module but getting error below:</p>
  
  <pre><code>Uncaught Error: [vuex] getters should be function but "getters.getComments" in module "comments" is [].
  </code></pre>
  
  <p><strong>/stores/comments.js</strong> (module)</p>
  
  <pre><code>import Vue from 'vue';
  import Vuex from 'vuex';
  
  Vue.use(Vuex);
  
  const state = {
      comments: []
  }
  
  const getters = {
      getComments: state =&gt; state.comments
  }
  const mutations = {
      setComments(state, comments) {
          state.comments = comments
      }
  }
  
  const actions = {
      setComments(context, data) {
          context.commit('setComments', data)
      }
  }
  export default new Vuex.Store({
      state,
      getters,
      mutations,
      actions
  })
  </code></pre>
  
  <p>and here is my store.js that contains root state of the vuex
  <strong>store.js</strong></p>
  
  <pre><code>import Vue from 'vue';
  import Vuex from 'vuex';
  import commentsModule from './stores/comments'
  Vue.use(Vuex);
  const state = {
  }
  
  const getters = {
  }
  
  const mutations = {
  }
  
  const actions = {
  
  }
  
  export default new Vuex.Store({
      state,
      getters,
      mutations,
      modules: {
          comments: commentsModule
      },
      actions
  })
  </code></pre>
  
  <p>Can you please help me to solve this issue. Tried but not understand what is the issue?</p>